You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copying this over from FabricMC/fabric-loom#1145 because I accidentally opened the issue on the wrong repo. (oopsies)
Issue
Unclear documentation in ServerLifecycleEvents causes events to be misappropriately used in certain scenarios.
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?
Proposed Solution
Documentation for SERVER_STOPPING and SERVER_STOPPED should be updated to mention
it is recommended that this event only be used for cleaning up resources that are created during SERVER_STARTING and SERVER_STARTED.
This event will not be emitted when using datagenning, and thus should be avoided by libraries for cleaning up resources (such as thread pools, databases, etc.) that were not started during SERVER_STARTING or SERVER_STARTED, as it will cause them to not get cleaned up.
The text was updated successfully, but these errors were encountered:
Copying this over from FabricMC/fabric-loom#1145 because I accidentally opened the issue on the wrong repo. (oopsies)
Issue
Unclear documentation in
ServerLifecycleEvents
causes events to be misappropriately used in certain scenarios.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.
ShouldServerLifecycleEvents.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?Proposed Solution
Documentation for
SERVER_STOPPING
andSERVER_STOPPED
should be updated to mentionThe text was updated successfully, but these errors were encountered: