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

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

Closed
FunkyNico opened this issue Aug 20, 2022 · 1 comment
Closed

Comments

@FunkyNico
Copy link

Hi, I 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.

Bookshelf Version: 3.1.0.0 / 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/csrUedH

Thanks =D

@LOOHP
Copy link
Owner

LOOHP commented Aug 20, 2022

Short answer: It should be fine, since server closing does not affect "gameplay performance" nor is it during "start up"
Long answer: Saving on the main thread is done on purpose on server shutdown. If you are wondering, bookshelf saves while the server is running are being done asynchronously all the time, it is only during shutdown that they are saved on the main thread. This is to make sure that all bookshelves are saved before the server fully closes, as the server does not wait for asynchronous threads to complete before closing, it only finishes up tasks on the main thread.

@LOOHP LOOHP closed this as completed Aug 20, 2022
@LOOHP LOOHP reopened this Aug 20, 2022
@LOOHP LOOHP closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants