Skip to content

Make sure GZIPOutputStream is always closed - #598

Merged
brian-brazil merged 1 commit into
prometheus:masterfrom
turbanoff:close_gzipoutputstream_always
Oct 15, 2020
Merged

Make sure GZIPOutputStream is always closed#598
brian-brazil merged 1 commit into
prometheus:masterfrom
turbanoff:close_gzipoutputstream_always

Conversation

@turbanoff

@turbanoff turbanoff commented Oct 14, 2020

Copy link
Copy Markdown
Contributor

Leave GZIPOutputStream open is dangerous as it leads to native memory leak.
Use try-finally to make sure stream is always closed

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is still here.

@brian-brazil brian-brazil left a comment

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor

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 <turbanoff@gmail.com>
@turbanoff
turbanoff force-pushed the close_gzipoutputstream_always branch from 87ba15c to 421bfe3 Compare October 15, 2020 15:46
@brian-brazil
brian-brazil merged commit 4618df7 into prometheus:master Oct 15, 2020
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

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