Log handler system isn't thread safe #3453
Labels
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
completed
The issue has been fully resolved and the change will be in the next Skript update.
priority: lowest
"Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
The current system for log handlers is not thread safe, due to its design. Two relatively long-lastig log handlers from seperate threads could cause problems when their timing intersects. Below is an example to demonstrate this issue:
Reproduce by executing the command, then reloading a script file.
Examples of errors which may occur: https://pastebin.com/dfPAb3Sd
While it is unlikely for someone to require parsing a string with the word 'cow' 12 times as entity types on a seperate thread, in unlucky occasions, this problem could crash the server / spam the console (I've seen it happen at least once before, possibly also caused #3291).
I'm not sure how the current system could be improved to avoid this issue, since simply making it no longer based on the list's order will, instead of erroring, cause log entries to be logged to the wrong handler.
The text was updated successfully, but these errors were encountered: