Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add handler call on unmounts #28

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

Open
willscott wants to merge 1 commit into master
base: master
Choose a base branch
Loading
from feat/handlerumount
Open

Conversation

@willscott
Copy link
Owner

@willscott willscott commented Mar 20, 2021

Allow handlers to correlate Mount and Unmount events to free resources like file handles when a client disconnects.

Copy link
Owner Author

upon testing, it looks like the unmount RPC call is only made when the nfs session has authentication. In the null authentication that's mostly being used, the unmounting of the device may (at least for linux clients) only be signaled through the closing of the TCP connection.

Copy link
Contributor

ozkatz commented Apr 7, 2024

Hey @willscott - thanks for this great library! How can I help in pushing this one past the finish line?

Copy link
Owner Author

PR welcome :) - i think it's probably not as drafted here, but rather on seeing the network connection terminate

Copy link
Contributor

ozkatz commented Apr 7, 2024
edited
Loading

@willscott that's a good idea, but from my experience with TCP in Go, I don't know that there's a safe cross-platform way (looking at you, Windows!) to check TCP connection "liveness".

The only reliable way to tell if a connection is truly open, is to try to read from it (>0 bytes), which introduces its own set of complexities.

See recap of the problem on go-sql-driver/mysql 's attempt at the same.


Additionally, naive question regarding NFS implementations in the wild:

Will closing a TCP connection to a server necessarily mean explicit unmounting?

I can imagine an NFS client driver closing idle connections after a while of inactivity and reconnecting on demand when accessed by the user. Perhaps the connection tracks state that forbids this?

Copy link
Owner Author

I think your concern is probably why there isn't a clear Unmount event that makes sense. The decision to unmount in a stateless protocol like NFS ends up being a hybrid between the server's policy on when to clean up state and clients signalling explicit disconnects.

I think there may be a useful event to raise to handlers on these explicit disconnects when they are signaled by clients, and that's probably what this should be, with the understanding that it won't be "complete"

ozkatz reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /