Skip to content

Close the file in case of an IOException in AbstractMemoryHttpData.renameTo.#10163

Merged
normanmaurer merged 2 commits intonetty:4.1from
seedeed:fd
Apr 6, 2020
Merged

Close the file in case of an IOException in AbstractMemoryHttpData.renameTo.#10163
normanmaurer merged 2 commits intonetty:4.1from
seedeed:fd

Conversation

@seedeed
Copy link
Copy Markdown
Contributor

@seedeed seedeed commented Apr 3, 2020

Motivation:

An IOException may be thrown from FileChannel.write or FileChannel.force, and cause the fd leak.

Modification:

Close the file in a finally block.

Result:

Avoid fd leak.

@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@normanmaurer
Copy link
Copy Markdown
Member

@netty-bot test this please

@normanmaurer
Copy link
Copy Markdown
Member

@netty-bot test this please

@normanmaurer normanmaurer added this to the 4.1.49.Final milestone Apr 6, 2020
@normanmaurer normanmaurer merged commit 3ebf3d7 into netty:4.1 Apr 6, 2020
@normanmaurer
Copy link
Copy Markdown
Member

@seedeed thanks a lot

normanmaurer pushed a commit that referenced this pull request Apr 6, 2020
…nameTo. (#10163)

Motivation:

An `IOException` may be thrown from `FileChannel.write` or `FileChannel.force`, and cause the fd leak.

Modification:

Close the file in a finally block.

Result:

Avoid fd leak.
ihanyong pushed a commit to ihanyong/netty that referenced this pull request Jul 31, 2020
…nameTo. (netty#10163)

Motivation:

An `IOException` may be thrown from `FileChannel.write` or `FileChannel.force`, and cause the fd leak.

Modification:

Close the file in a finally block.

Result:

Avoid fd leak.
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.

3 participants