Repository navigation
Conversation
Stdlib.exit calls flush_all which does a blocking write() on every unflushed out_channel. One stale channel whose fd was reused by an unread socket blocks it forever. Use Unix._exit instead which doesn't call flush_all. Signed-off-by: Bengang Yuan <bengang.yuan@citrix.com>
BengangY
marked this pull request as ready for review
October 30, 2026 01:03
Start a timer in the fuse process to force exiting the process if it is still running fuse_exit_grace seconds (default 60) after the fuse delay. Signed-off-by: Bengang Yuan <bengang.yuan@citrix.com>
last-genius
requested changes
Oct 30, 2026
| let force_exit_after_grace ~fuse_length ret_code = | ||
| let wait = fuse_length +. !Constants.fuse_exit_grace in | ||
| try | ||
| ignore (Thread.create (fun () -> Thread.delay wait ; Unix._exit ret_code) ()) ; |
Contributor
There was a problem hiding this comment.
Could there be a log that xapi exited in an unintended way here? Or do we want to avoid hanging on the log as well?
Contributor
Author
There was a problem hiding this comment.
Logging on exit may also block in syslog, so I didn't add a log.
BengangY
force-pushed
the
private/bengangy/CA-432805-fuse-exit
branch
from
November 2, 2026 06:11
cc40ce8 to
eb672a2
Compare
last-genius
approved these changes
Nov 2, 2026
changlei-li
approved these changes
Nov 2, 2026
| let fuse_time = ref 10. | ||
|
|
||
| (* the time the fuse allows for flush and exit before forcing the process out *) | ||
| let fuse_exit_grace = ref 60. |
Member
There was a problem hiding this comment.
what is the reason you select 60 for fuse_exit_grace?
The thread is created before stats stop and rrdd backup, is it intentional?
Contributor
There was a problem hiding this comment.
I asked for the thread start to be moved above: #7364 (comment)
LunfanZhang
approved these changes
Nov 3, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the fuse exits xapi,
Stdlib.exitrunsflush_all, which can block forever writing a stale channel whose fd has been reused by an unread socket. The process then never exits.Unix._exitinstead ofStdlib.exit, which skipsflush_all.fuse_exit_graceseconds (default 60) after the fuse delay.