Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid file system watches on read-only mounts #20669

Closed
andrewrk opened this issue Jul 18, 2024 · 2 comments
Closed

avoid file system watches on read-only mounts #20669

andrewrk opened this issue Jul 18, 2024 · 2 comments
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. optimization os-linux zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Jul 18, 2024

Follow-up from #20580.

name_to_handle_at gives us a mount ID here:

try posix.name_to_handle_at(path.root_dir.handle.fd, adjusted_path, stack_ptr, &mount_id, std.os.linux.AT.HANDLE_FID);

If this mount is read-only then the watch system should not waste any resources placing a mark on any directories within because they will never change!

Related:

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. optimization os-linux zig build system std.Build, the build runner, `zig build` subcommand, package management labels Jul 18, 2024
@andrewrk andrewrk added this to the 0.15.0 milestone Jul 18, 2024
@rohlem
Copy link
Contributor

rohlem commented Jul 18, 2024

No insight on the particulars of read-only mounts, but I assume they could be un-mounted and then re-mounted with different data while the program is running?
That could either be considered an error and explicitly unsupported, or supported by a "mount watch" mechanism spanning all files within (maybe by only watching the first file on it, if that tells us enough to detect re-mounting?).

@andrewrk
Copy link
Member Author

ehh if that's possible and it doesn't even change the mount id then this should be closed

@andrewrk andrewrk closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
@andrewrk andrewrk modified the milestones: 0.15.0, 0.14.0 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. optimization os-linux zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

No branches or pull requests

2 participants