Parent of SSHFS mountpoint frozen upon network failure

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Parent of SSHFS mountpoint frozen upon network failure

Vlad C.
Hi,

I simulated a network failure by unplugging the
network cable from my computer. Before doing that, I
had mounted an SSHFS share on /home/vlad/test_ssh.

After unplugging the cable, I wasn't able to list the
contents of my home directory ("ls /home/vlad"  just
froze). Then, I switched to another user ("su user2")
who has read/execute access to /home/vlad. User2 had
no problem listing the contents of /home/vlad (but of
course /home/vlad/test_ssh did not appear).

I understand why the mountpoint itself will freeze in
the event of a network failure, but is it possible to
avoid freezing its parent directory?

Thank you,
Vlad


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Parent of SSHFS mountpoint frozen upon network failure

Ian C. Blenke
What is the best way to spawn a pthread on init after calling fuse_main()?

I have a background thread I'd like to spawn when cornfs starts, but I'm
guessing that such an action needs to spawn after pthread_init somewhere
before the event loop starts.

Cheers,

 - Ian C. Blenke <[hidden email]>
http://ian.blenke.com/projects/cornfs/cornfs.html


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Parent of SSHFS mountpoint frozen upon network failure

Ian C. Blenke
Ian C. Blenke wrote:

> What is the best way to spawn a pthread on init after calling
> fuse_main()?
>
> I have a background thread I'd like to spawn when cornfs starts, but
> I'm guessing that such an action needs to spawn after pthread_init
> somewhere before the event loop starts.

My apologies. That's what init() appears to be for. It's documented
right there in fuse.h. Long running background thread now working just fine.

*sigh* I think it's time for some rest now, no more late night coding
for me.

 - Ian C. Blenke <[hidden email]>
http://ian.blenke.com/projects/cornfs/cornfs.html



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Parent of SSHFS mountpoint frozen upon network failure

Miklos Szeredi
In reply to this post by Vlad C.
> I simulated a network failure by unplugging the
> network cable from my computer. Before doing that, I
> had mounted an SSHFS share on /home/vlad/test_ssh.
>
> After unplugging the cable, I wasn't able to list the
> contents of my home directory ("ls /home/vlad"  just
> froze). Then, I switched to another user ("su user2")
> who has read/execute access to /home/vlad. User2 had
> no problem listing the contents of /home/vlad (but of
> course /home/vlad/test_ssh did not appear).
>
> I understand why the mountpoint itself will freeze in
> the event of a network failure, but is it possible to
> avoid freezing its parent directory?

The parent directory will freeze, only because 'ls' stats each entry.

Try '/bin/ls dir', that will probably work fine.  'ls' is usually an
alias, that does coloring, etc., and that unfortunately touches the
mountpoint.

Miklos


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Parent of SSHFS mountpoint frozen upon network failure

Terje Oseberg
On 8/6/05, Miklos Szeredi <[hidden email]> wrote:

> > I simulated a network failure by unplugging the
> > network cable from my computer. Before doing that, I
> > had mounted an SSHFS share on /home/vlad/test_ssh.
> >
> > After unplugging the cable, I wasn't able to list the
> > contents of my home directory ("ls /home/vlad"  just
> > froze). Then, I switched to another user ("su user2")
> > who has read/execute access to /home/vlad. User2 had
> > no problem listing the contents of /home/vlad (but of
> > course /home/vlad/test_ssh did not appear).
> >
> > I understand why the mountpoint itself will freeze in
> > the event of a network failure, but is it possible to
> > avoid freezing its parent directory?
>
> The parent directory will freeze, only because 'ls' stats each entry.
>
> Try '/bin/ls dir', that will probably work fine.  'ls' is usually an
> alias, that does coloring, etc., and that unfortunately touches the
> mountpoint.
>
> Miklos
>

It's up to your userspace filesystem, and how it responds to a request
when the data is not available. If, "ls" is doing a stat on the root
of your mount, then you should respond with permissions that you have
cached rather than going out to the remote system fetching the info.

Terje


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Parent of SSHFS mountpoint frozen upon network failure

Miklos Szeredi
> It's up to your userspace filesystem, and how it responds to a request
> when the data is not available. If, "ls" is doing a stat on the root
> of your mount, then you should respond with permissions that you have
> cached rather than going out to the remote system fetching the info.

It will, until the cache timeout (which is 20s by default IIRC).
After that it will try to fetch it from the server.

Now an interesting mode of operation would be if it would always
return the cached data/metadata, but at the same time (if the
data/metadata is stale) it would start to fetch from the server.  This
would ensure, that on disconnection things already in the cache would
be available, but also if connected, then data would only be stale for
a single request.  It would also be very fast for slow connections.

A slightly different strategy, would be to have a timeout for
requests, and after that, return an error or the cached data.  This
combined with a connected/disconnected state would be pretty useful.

These could probably be done as a separate, filesystem-independent
layer.  Anyone want to play with these ideas?

Miklos



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel