Skip to content

Conversation

freddy77
Copy link
Collaborator

Make sure we release the sock file descriptors in all cases.
Add test trying to reproduce the issue passing an invalid file descriptor; not a perfect reproduction but failure in this function can happen for instance if daemon is restarted.

@freddy77 freddy77 requested review from lindig, psafont and robhoes April 26, 2024 09:52
fail is always used in combination with Printf.sprintf so combine the two.

Signed-off-by: Frediano Ziglio <[email protected]>
More compact code.

Signed-off-by: Frediano Ziglio <[email protected]>
"exe" variable is compute in mutiple functions, not very expensive to
compute once.
Reduce code.

Signed-off-by: Frediano Ziglio <[email protected]>
Make sure we release the "sock" file descriptors in all cases.
Add test trying to reproduce the issue passing an invalid file descriptor; not
a perfect reproduction but failure in this function can happen for instance if
daemon is restarted.

Signed-off-by: Frediano Ziglio <[email protected]>
We just want information about the current process.

Signed-off-by: Frediano Ziglio <[email protected]>
@freddy77 freddy77 requested a review from GabrielBuica April 30, 2024 08:42
@freddy77
Copy link
Collaborator Author

ping

In case of getting the list of files we called Unix.readlink twice for every file
descriptor.
In case we wanted just the count we computed the list anyway.
Factor out code to avoid calling function twice and do not compute the list
is not needed.

Signed-off-by: Frediano Ziglio <[email protected]>
@robhoes robhoes merged commit 09d0a3e into xapi-project:master May 22, 2024
@freddy77 freddy77 deleted the leak_fd branch June 11, 2024 14:23
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.

5 participants