r4g3baby / SimpleScore

A simple animated scoreboard plugin for your minecraft server.
https://www.spigotmc.org/resources/simplescore.23243/
MIT License
68 stars 32 forks source link

Suggestion about performing a blocking I/O operation on the main thread #47

Closed FunkyNico closed 1 year ago

FunkyNico commented 1 year ago

Hello, I have found this suggestion from another spigot plugin called Lagmonitor : Make stop the plugin from doing a blocking I/O operation on the main thread because this could affect the server performance, the thread pauses until it gets the response. Such operations should be performed asynchronous from the main thread. Besides gameplay performance it could also improve startup time.

In this case looks like this happen when the server is closing up.

SimpleScoreboard Version: 3.12.1 / Server: Purpur-1762 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 39e30d6 on HEAD).

Log: https://logs.apexminecrafthosting.com/U35H8fu

Thanks.

r4g3baby commented 1 year ago

Hey, this is intentional behaviour that doesn't affect server performance at all since it only does this during shutdown. The main thread needs to be blocked during shutdown to prevent the server from closing before it's done saving all the player information, otherwise data would be lost.