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
ERROR: Cannot schedule tasks on an EventLoop that has already shut down.
This will be upgraded to a forced crash in future SwiftNIO versions.
and seems to shut down everything and exit normally.
This is a pretty big inconvenience as in any more or less complex project the code that bootstraps the server will most likely be in a function.
The main suspicion is that some destructor is called at the end of run() that tries to use an EventLoop. No idea which object in the main code that might be. Any help would be greatly appreciated!
The function should isolate the quiesce object into a smaller block to ensure that its destructor is executed before the call to group.syncShutdownGracefully() like so:
func run()throws{letgroup=MultiThreadedEventLoopGroup(numberOfThreads:System.coreCount)do{letquiesce=ServerQuiescingHelper(group: group)// ... rest of the code ...try fullyShutdownPromise.futureResult.wait()}try group.syncShutdownGracefully()}tryrun()
Expected behavior
The demo should be able to shutdown gracefully on SIGINT.
Actual behavior
If the top-level code is wrapped in a function like so:
then upon receiving SIGINT the app prints:
and seems to shut down everything and exit normally.
This is a pretty big inconvenience as in any more or less complex project the code that bootstraps the server will most likely be in a function.
The main suspicion is that some destructor is called at the end of
run()
that tries to use an EventLoop. No idea which object in the main code that might be. Any help would be greatly appreciated!SwiftNIO-Extras version/commit hash
Current HEAD, a33bb16
Swift & OS version
Swift 5.10
macOS 14.3.1 (23D60)
The text was updated successfully, but these errors were encountered: