Skip to content

Conversation

@ubnt-intrepid
Copy link
Owner

@ubnt-intrepid ubnt-intrepid commented Nov 2, 2025

No description provided.

@ubnt-intrepid
Copy link
Owner Author

@copilot apply the changes to other examples contained in examples/.

Copy link

Copilot AI commented Nov 2, 2025

@ubnt-intrepid I've opened a new pull request, #259, to work on those changes. Once the pull request is ready, I'll request review from you.

@ubnt-intrepid ubnt-intrepid changed the title add signal handling to examples add signal handling facilities Nov 2, 2025
@ubnt-intrepid ubnt-intrepid marked this pull request as ready for review November 2, 2025 17:06
@ubnt-intrepid ubnt-intrepid requested a review from Copilot November 2, 2025 17:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the signal handling and unmounting behavior for FUSE mounts. The changes move from automatic unmounting via Drop to explicit signal-based unmounting, requiring users to manually handle mount cleanup after receiving interruption signals.

Key changes:

  • Removes AUTO_UNMOUNT as the default FuseFlags behavior
  • Removes Drop implementation from Mount struct
  • Adds signal handling using the signal-hook crate to detect SIGHUP, SIGTERM, and SIGINT
  • Updates all examples to use scoped threads with explicit mount handle cleanup

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/mount.rs Adds signal handling infrastructure, removes auto-unmount default and Drop impl, adds unmount_after_interrupted() method
examples/poll.rs Updates to use explicit signal-based unmounting pattern with thread scopes
examples/hello.rs Updates to use explicit signal-based unmounting pattern with thread scopes
examples/heartbeat_entry.rs Updates to use explicit signal-based unmounting pattern with thread scopes
examples/heartbeat.rs Updates to use explicit signal-based unmounting pattern with thread scopes
examples/basic.rs Updates to use explicit signal-based unmounting pattern with thread scopes
Cargo.toml Adds signal-hook dependency and io_uring feature to rustix

Comment on lines +188 to +189
"caught the interruption signal: {:?}",
rustix::io_uring::Signal::from_named_raw(sig)
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rustix::io_uring::Signal type is being used to format signal numbers, but io_uring is an async I/O subsystem unrelated to POSIX signals. The io_uring feature was likely added for other reasons, but this usage appears incorrect. Consider using a more appropriate signal formatting mechanism, such as directly displaying the signal number or using libc signal constants for formatting (e.g., matching against SIGHUP, SIGTERM, SIGINT directly).

Suggested change
"caught the interruption signal: {:?}",
rustix::io_uring::Signal::from_named_raw(sig)
"caught the interruption signal: {}",
match sig {
SIGHUP => "SIGHUP",
SIGTERM => "SIGTERM",
SIGINT => "SIGINT",
_ => {
// Fallback: show the signal number
return format!("signal {}", sig);
}
}

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/mount.rs:165

  • Corrected spelling of 'priviledged' to 'privileged'.
    pub fn is_priviledged(&self) -> bool {

@ubnt-intrepid
Copy link
Owner Author

一旦リジェクト

@ubnt-intrepid ubnt-intrepid deleted the add-signal-handlers branch November 3, 2025 09:27
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.

2 participants