-
Notifications
You must be signed in to change notification settings - Fork 798
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
Make sure GZIPOutputStream is always closed #598
Make sure GZIPOutputStream is always closed #598
Conversation
simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java
Show resolved
Hide resolved
private final LocalByteArray response = new LocalByteArray(); | ||
private final static String HEALTHY_RESPONSE = "Exporter is Healthy."; | ||
private final Charset UTF_8 = Charset.forName("UTF-8"); |
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.
This new indirection just makes the code harder to read for me.
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.
This is still here.
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.
Can you also add the DCO?
private final LocalByteArray response = new LocalByteArray(); | ||
private final static String HEALTHY_RESPONSE = "Exporter is Healthy."; | ||
private final Charset UTF_8 = Charset.forName("UTF-8"); |
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.
This is still here.
Signed-off-by: Andrey Turbanov <[email protected]>
87ba15c
to
421bfe3
Compare
Thanks! |
Leave GZIPOutputStream open is dangerous as it leads to native memory leak.
Use try-finally to make sure stream is always closed