Skip to content
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

in_exec: fix a file descriptor leaks #3634

Closed
wants to merge 1 commit into from

Conversation

kenhys
Copy link
Contributor

@kenhys kenhys commented Feb 15, 2022

Which issue(s) this PR fixes:

Follow up #3627

What this PR does / why we need it:

Every calling command from in_exec plugin, it causes
a file descriptor leak.

If interval is short enough or running Fluentd in long term,
it will reaches the limit of file descriptor - "too many open files".

In this commit, ensure to close IO object when it reaches EOF.

Docs Changes:

N/A

Release Note:

N/A

Every calling command from in_exec plugin, it causes
a file descriptor leak.

If interval is short enough or running Fluentd in long term,
it will reaches the limit of file descriptor - "too many open files".

In this commit, ensure to close IO object when it reaches EOF.

Signed-off-by: Kentaro Hayashi <[email protected]>
@@ -95,6 +95,7 @@ def run(io)
else
@parser.parse(io.read, &method(:on_record))
end
io.close if io.eof?
Copy link
Member

@ashie ashie Feb 17, 2022

Choose a reason for hiding this comment

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

Generally speaking, resources should be closed by the one who opened it.
I'm not sure but closing it here might not be appropriate.

@kvokka kvokka mentioned this pull request Feb 20, 2022
@LukasJerabek
Copy link

Id just like to point out also here, that in #3627 I dont observe problems with in_exec itself, but only in combination of in_exec with out_exec.

@github-actions
Copy link

This PR has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this PR will be closed in 30 days

@github-actions github-actions bot added the stale label May 29, 2022
@LukasJerabek
Copy link

Bump.

@github-actions github-actions bot removed the stale label Jun 2, 2022
@ashie
Copy link
Member

ashie commented Jul 28, 2022

I can't reproduce the issue.
In addition, I don't think it's proper way as I mentioned before.

@ashie ashie closed this Jul 28, 2022
@kenhys kenhys deleted the fix-in-exec-fd-leak branch August 3, 2023 08:45
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