Skip to content

Show number of CraftTasks on Bukkit/Paper platform #503

Open
@PanSzelescik

Description

@PanSzelescik

Description

Hello, we had a very interesting case that we analysed a bit: https://spark.lucko.me/imXwP7DUMQ

Analysing the Spark profiler result, you could actually see just that:
Image

The lag was caused by cancelling one of CraftTasks, which adds a CraftTask that looks for that CraftTask in order to cancel it. This causes an iteration through all CraftTasks to search for it, which, at 1 500 000 (!), caused quite a lag.

By analysing the heapdump we found which plugin added this amount of CraftTasks:
Image

Proposed Behaviour

My suggestion is to add a check of the number of CraftTasks (org.bukkit.craftbukkit.scheduler.CraftTask) in the CraftScheduler with the possibility to check:

  • is sync or async (org.bukkit.craftbukkit.scheduler.CraftAsyncTask)
  • which plugin added how many Tasks

This would certainly speed up the analysis of lags caused by such cases.

Extra Details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions