Skip to content

Conversation

@KSSKarthikeya
Copy link
Contributor

@KSSKarthikeya KSSKarthikeya commented Oct 3, 2025

fluentd_exporter.cc Connect() function is causing socket leak when the connection fails.

Test results: Open FDs count stopped increasing after fix.

Every 2.0s: /workspace/pid_watch.sh                                                                qemux86-64: Fri Oct  3 20:15:02 2025

Time: 2025-10-03 20:15:02  PID: 1827
---- /proc/1827/limits ----
Limit                     Soft Limit           Hard Limit           Units
Max open files            1024                 4096                 files
---- FD usage ----
open_fds: 11  max_fds: 1024 4096
---- Socket counts (tcp/udp/unix) ----
tcp lines: 14
udp lines: 4
unix lines: 11
Every 2.0s: /workspace/pid_watch.sh                                                                  qemux86-64: Fri Oct  3 20:16:59 2025

Time: 2025-10-03 20:16:59  PID: 1827
---- /proc/1827/limits ----
Limit                     Soft Limit           Hard Limit           Units
Max open files            1024                 4096                 files

---- FD usage ----
open_fds: 11  max_fds: 1024 4096
---- Socket counts (tcp/udp/unix) ----
tcp lines: 14
udp lines: 4
unix lines: 11

@KSSKarthikeya KSSKarthikeya requested a review from a team as a code owner October 3, 2025 17:24
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 3, 2025

CLA Signed

  • ✅login: KSSKarthikeya / name: Karthikeya K S S / (6823050)
  • ✅login: KSSKarthikeya / name: Karthikeya K S S / (6823050, 991f0cb)

The committers listed above are authorized under a signed CLA.

if (!socket_.invalid()) {
socket_.close();
}
connected_ = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this set of connected_ to false necessary? Seems unnecessary because it is already in false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ThomsonTan , thanks for pointing that out, I have removed it.
Can this be approved ?

@ThomsonTan ThomsonTan merged commit 78e2a71 into open-telemetry:main Oct 3, 2025
2 checks passed
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