Skip to content

Use shutdown hook to write the remaining events #44

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

borisbsu
Copy link

Use shutdown hook to write the remaining events to CloudWatch when JVM shuts down.

* We have been interrupted so write all of the rest of the events and then quit
*/

events.clear();
Copy link
Author

@borisbsu borisbsu Mar 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: We shouldn't clear events because it can contain some messages which were not pushed into CloudWatch yet.

@j256
Copy link
Owner

j256 commented Mar 11, 2022

Thanks for this. I don't like making this a default. Making network connections while the JVM is shutting down seems like something the user can opt into. Maybe add a boolean to the configuration and default it to false?

@borisbsu
Copy link
Author

@j256 I have added a new flushEventsOnShutdown param to control this behavior.

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

Successfully merging this pull request may close these issues.

2 participants