Skip to content

Fuse_daemon: Always attempt to clear out stale mounts before mounting#1749

Draft
Nathan Graybeal (ngraybeal) wants to merge 1 commit intomasterfrom
nathang/fuse_daemon_setup_lazy_unmount
Draft

Fuse_daemon: Always attempt to clear out stale mounts before mounting#1749
Nathan Graybeal (ngraybeal) wants to merge 1 commit intomasterfrom
nathang/fuse_daemon_setup_lazy_unmount

Conversation

@ngraybeal
Copy link
Copy Markdown
Contributor

Create a persistant daemon started by Wake runtime, instead of wakebox to reduce the up/downtime costs and possible flakiness of those actions.

Comment thread tools/fuse-waked/main.cpp
#ifndef __APPLE__
// Attempt to lazily unmount a stale mount point (fails silently if not mounted)
static void try_unmount_stale(const char *path, bool debug) {
std::string cmd = "fusermount -uz '" + std::string(path) + "' 2>/dev/null";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any way we can check if a fuse mount exists before unmounting it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah you can do mountpoint. The only reason to do that is if we care about catching fusermount-uz failures. Otherwise, fusermount -uz just basically makes the same check and exits if it's not.

Comment thread tools/fuse-waked/main.cpp
try_unmount_stale(path.c_str(), debug);
#endif

fc = fuse_mount(path.c_str(), &args);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any race conditions that can happen when we unmount and then immediately try to mount? What if the mount is still cleaning up?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't believe so. The -z should be immediate allowing a new mount to land.

Copy link
Copy Markdown
Contributor

@AbrarQuazi Abrar Quazi (AbrarQuazi) left a comment

Choose a reason for hiding this comment

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

LGTM

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