Skip to content

(FACT-3446) Call close(2) with Solaris FFI #2632

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

Conversation

mhashizume
Copy link
Contributor

Previously, when Facter ran on Solaris it would use shutdown(2) to attempt to close open sockets. However, this would leak file descriptors and occasionally cause an issue where the system would hit its maximum open files.

This commit updates Facter to instead use close(2) on Solaris to ensure that file descriptors are not leaked.

Previously, when Facter ran on Solaris it would use shutdown(2) to
attempt to close open sockets. However, this would leak file descriptors
and occasionally cause an issue where the system would hit its maximum
open files.

This commit updates Facter to instead use close(2) on Solaris to ensure
that file descriptors are not leaked.
@mhashizume mhashizume requested a review from a team as a code owner October 26, 2023 18:22
@joshcooper joshcooper merged commit a3d61a3 into puppetlabs:main Oct 26, 2023
@joshcooper
Copy link
Contributor

For posterity, facter 3 used a scoped_descriptor to manage the socket's lifetime and it called close when the scoped_descriptor went out of scope:

@mhashizume mhashizume deleted the FACT-3446/main/solaris-socket-descriptors branch October 26, 2023 19:30
@joshcooper joshcooper added the bug Something isn't working label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants