Fix Antares append and unmount FUSE races - #8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 900309f0ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Look up config first so we can quiesce without holding the state lock. | ||
| let config = match self.instances.lock().await.get(job_id) { |
There was a problem hiding this comment.
Reserve the job id before quiescing unmounts
When an unmount is sleeping here, the instances lock has already been dropped, so a concurrent mount_job_at for the same job_id can finish mounting a different custom mountpoint and overwrite both maps before this method reaches fuse_handles.remove(job_id). In that race this unmount removes and tears down the newly inserted AntaresFuse while the original FUSE session can be left orphaned and untracked; the old implementation held the state lock across the unmount and prevented that interleaving. Please reserve/remove or mark the job as unmounting before awaiting the grace period.
Useful? React with 👍 / 👎.
Summary
EBADFwhen appending to existing filesVerification
cargo test --test antares_test test_fuse_append_existing_file -- --exact --ignored --nocapture --test-threads=1cargo test unmount_grace_duration