Add manual exit at the end of FUSE life cycle #18211
Merged
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.
What changes are proposed in this pull request?
Added a manual double-safety
System.exit()
at the end of FUSE lifecycle, to be absolutely sure we exit the JVM and terminate all non-daemon & daemon threads.Before this change, after we
alluxio-fuse umount
orkill (not -9)
, the FUSE process may fail to quit. One reason is a non-daemon thread dangling around:The JVM shutdownHook executes after the LAST non-daemon thread dies or when
System.exit()
triggers. So if some libraries we use or some thread pools of ours accidentally introduce non-daemon threads,System.exit()
is our last resort to trigger shutdownHook.FUSE does handle signals and exit, but there are some corner cases which don't seem to trigger that successfully. So this PR serves as the last resort.
alluxio/dora/integration/fuse/src/main/java/alluxio/fuse/FuseSignalHandler.java
Line 52 in 527ffe8
Why are the changes needed?
See above
Does this PR introduce any user facing changes?
No