fix(gateway): close file descriptor after reading /proc/<pid>/cmdline - #36842
fix(gateway): close file descriptor after reading /proc/<pid>/cmdline#36842kyssta-exe wants to merge 1 commit into
Conversation
mxnstrexgl
left a comment
There was a problem hiding this comment.
🤖 Automated PR Review
Security Scan
- ✓ No hardcoded secrets, injection sinks, unsafe deserialization, or dependency red flags found by this automated scan.
Code Quality
- ✓ No blocking code-quality issues found by this automated scan.
Summary
Status: APPROVE — security findings: 0, quality suggestions: 0.
Automated review; raw diff content intentionally omitted.
|
👋 fixes a file descriptor leak in _scan_gateway_pids — /proc//cmdline was opened without a context manager, leaking one FD per process. Now uses . Low risk, follows standard Python patterns. |
|
|
5e48a22 to
419026c
Compare
|
Closing — duplicate of #36804 (same FD leak fix in gateway.py, same title). |
The _scan_gateway_pids function in gateway.py opens /proc//cmdline for every process on the host without a context manager, leaking one file descriptor per matching process. While CPython GC eventually collects unclosed files, on a heavily loaded gateway host this can exhaust the process FD limit over repeated status checks.