You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Audit and test OSProcess open file limit implementations #3286
While reviewing PR #3285, diff coverage highlighted that the Linux FFM implementations of LinuxOSProcessFFM.queryRlimitSoft() and LinuxOSProcessFFM.queryRlimitHard() are effectively uncovered. The missing coverage is not introduced by that PR; it exposed an existing testing gap around the OSProcess open file limit API.
Issue #2215 was completed by PR #2225 and did add process-specific open file descriptor limit APIs across multiple platforms. However, the current test coverage appears to be mostly API-level smoke coverage, and does not give much confidence that the per-platform implementations, or the JNA/FFM equivalents, return consistent and correct values.
Findings
OSProcess exposes getSoftOpenFileLimit() and getHardOpenFileLimit().
Implementations exist across Linux, macOS, AIX, FreeBSD, OpenBSD, Solaris, and Windows.
Linux now has backend-specific hooks (queryRlimitSoft() / queryRlimitHard()) for native-free, JNA, and FFM implementations.
Existing shared tests only assert broad nonnegative/-1 behavior for the current process, and do not meaningfully compare JNA vs. FFM results.
While auditing, MacOSProcessFFM stood out as suspicious: it checks getrlimit(...) > 0, but POSIX getrlimit() succeeds with return value 0. That should be verified and fixed if confirmed.
Suggested work
Add or improve smoke tests for OSProcess.getSoftOpenFileLimit() and getHardOpenFileLimit().
Add FFM-vs-JNA comparison coverage where the test infrastructure supports it.
Audit each platform implementation for correctness, especially success/error handling around native getrlimit() calls.
Confirm whether the macOS FFM getrlimit() success check should be == 0 rather than > 0.
Activity