-
Notifications
You must be signed in to change notification settings - Fork 175
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
Closing httpclient properly on logback shutdown #112
Conversation
Code at present only closes httpclient, if `eventsBatch.size() > 0`. But there might be scenarios where logback calls shutdown and there are no events to flush. Therefore `sender.stopHttpClient()` never being called preventing a main method exit due to non-deamon thread usage of httpClient.
@SuramVishal This change seems fine. Have you verified that it addresses your issue? Please fix the indents so it matches the rest of the file. |
@shakeelmohamed Yes, I have tested this and it does address my issue. Would you be able to make this a part of a new release (potentially 1.7.2) now? Would be really helpful, so that we can use this in our work. Thanks for the swift review by the way. |
Hi @shakeelmohamed any help? :) |
@SuramVishal do you have some steps to reproduce the issue? This will definitely be in the next release, I'm not exactly sure when that will be though. |
Okay to reproduce:
with logback appender as
|
@shakeelmohamed It would be really helpful if you can help prioritise this issue. This is major when it comes to all short living applications using splunk appender. :) Please do let me know if you need any further details. |
Hey @SuramVishal thanks for the testcase, I'm going to try to reproduce this today and hopefully get this merged. Thanks for your help! |
@fantavlik, much appreciated. Please let me know if you have any difficulties in reproducing. :) |
Apologies, I ran into issues setting up my environment. I've been able to repro the fact that the httpClient is not closed for your setup. Thanks for your contribution and we will get this into the next release. |
Thank you @fantavlik , @shakeelmohamed for reviewing the PR. May I kindly know when the next release would be? Can we get it asap? So that we can continue to use the library in our work. :) |
I'm cutting a 1.7.2 release today! 🎉 |
Code at present only closes httpclient, if
eventsBatch.size() > 0
.But there might be scenarios where logback calls shutdown and there are no events to flush. Therefore
sender.stopHttpClient()
never being called preventing a main method exit due to non-deamon thread usage of httpClient.