-
Notifications
You must be signed in to change notification settings - Fork 212
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
ServerLifecycleEvents
not triggered for datagen
#1145
Comments
I believe |
Neither of these should be fired during data generation. If the starting one is then it's a bug. (Report it to FabricAPI) I would almost always create your threads as daemons, Minecraft doesn't really have much of a concept of shutting down beyond saving the world. The essayist way to clean everything up is to close the entire process. |
wait I just realized I opened this on the wrong repo lmao 💀 |
I moved the issue over to the fabric api repo, and also updated it to indicate that a documentation change is desired, rather than a code change. |
When using datagen in a dev env,
ServerLifecycleEvents
are not triggered.This can cause issues with mods/apis that, for example, rely on
ServerLifecycleEvents.SERVER_STOPPING
to clean up some resources.As an example, I ran into this issue with AzureDoom/AzureLib#62, where a thread executor is spawned in non-daemon mode, and will be closed down when the
ServerLifecycleEvents.SERVER_STOPPING
event is emitted.However, since it is never emitted, this causes the datagen to never exit, as the jvm sees that there's an active thread that is not marked as a daemon thread.
Should
ServerLifecycleEvents.SERVER_STOPPING
be emitted when the datagen finishes, or should it be added to the docs to not use it for cleaning up resources, as it can fail during datagen?The text was updated successfully, but these errors were encountered: