Repository navigation
vm: inotify: also trigger IN_CLOSE_WRITE when syncing file events - #1643
Merged
Merged
Conversation
Signed-off-by: Florent Giraud <florent.giraud@flare.io>
1 of 5 tasks
Owner
|
Thanks :) |
abiosoft
approved these changes
Oct 2, 2026
Contributor
Author
|
Thank you for the merge 🙏 🚀 just checking with you when do you think the release will be ? |
Owner
Hopefully within a week. |
1 of 5 tasks
This was referenced Oct 8, 2026
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.
Fixes #1244. Related: #1341.
Problem
With
--mount-inotify, Colima replays host file changes in the guest by runningchmodwith the file's current mode. Containers therefore only receiveIN_ATTRIB. Watchers that ignore attribute-only events never react, for example Pants (pants --loop), which drops every metadata change except permissions (source), orair(#1341).Change
The sync command now also opens the file for writing and closes it, without writing anything:
chmodis kept, so watchers that rely onIN_ATTRIBbehave exactly as before.: >> "$2"opens the file in append mode and closes it, which makes the kernel emitIN_OPEN+IN_CLOSE_WRITE. No byte is written.The command is built by a small
syncEventCmd()helper so it can be unit tested.Why it doesn't hit the editor problem from #1244
As we don't change the file on the host the editor shoud not be confuse with that.
Tests
events_test.go: unit test of the generated command, including a path with spaces and quotes.events_linux_test.go(Linux only, runs in CI): runs the command on a temp file, then asserts that inotify reportsIN_ATTRIBandIN_CLOSE_WRITEbut notIN_MODIFY, andThe command is built by a small
syncEventCmd()helper so it can be unit tested.Manual end-to-end test (macOS 26.7 Apple Silicon, vz + virtiofs, docker runtime) on a real multi-container dev stack, editing files on the host:
pants --loop test: now reruns tests (didn't react before);--reload, Vite dev server,cargo watch: still reload as before.LLM usage disclosure
This change was written with the help of an LLM (Claude): the investigation and the fix. The test was written manually with some guidance of claude because it's not a language I am confident enough to write something good but I reviewed every line and ran all the tests above myself.