Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tasks leaking after match end #1383

Merged
merged 5 commits into from
Aug 16, 2024
Merged

Fix tasks leaking after match end #1383

merged 5 commits into from
Aug 16, 2024

Conversation

Pablete1234
Copy link
Member

This fixes a pretty critical bug, at the moment the pgm task executor is storing tasks in a skiplist set, that is sorted by natural order of compareTo, however that compareTo of tasks is always 1 or 0 for done/not done, resulting in all tasks but 1 being disregarded as "already in the set".

What this means is at match end (cycling to next match) when it's time to cleanup, it can only cleanup one task, all others are left at mercy of being cleared whenever they next try to run (at which point they see the executor has shutdown and they clean themselves up).

This is in particular bad for one task: the scoreboard rendering one. Because it is intentionally timed out forever so it doesn't render after match end, it leaves a forever lingering task that executes in Integer.MAX_VALUE amount of time, so it is never cleaned, holding a permanent reference to the match object.

Signed-off-by: Pablo Herrera <[email protected]>
@Pablete1234 Pablete1234 added the bug Something isn't working label Aug 16, 2024
cswhite2000
cswhite2000 previously approved these changes Aug 16, 2024
Signed-off-by: Pablo Herrera <[email protected]>
@Pablete1234 Pablete1234 merged commit f0f212f into dev Aug 16, 2024
2 checks passed
@Pablete1234 Pablete1234 deleted the fix-task-leak branch August 16, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants