-
Notifications
You must be signed in to change notification settings - Fork 56
Make sure Fluent is shutdown on exit #2014
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and nice that you are adding a test that can work both with and without containers as well
Very minor suggestion would be to rename _exit_evt to _exit_event just to make this var name clearer/obvious
Thanks for the suggestions, they are very helpful. |
session.exit()is handled in a daemon thread (MonitorThread) which ensures shutdown of all streaming (non-daemon) threads. A daemon thread is terminated abruptly during Python process exit, after all non-daemon threads are exited). In the current code, the streaming threads are shut down after the server is exited withinsession.exit(). The MonitorThread shuts down immediately after shutting down the streaming threads without exiting the last server.In this PR, a long-running thread is added which is exited at the end of
session.exit()to ensure everything withinsession.exit()gets executed during exit.Need to see how to unittest this (need a Python process exit).