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

Fish hangs indefinitely with no output if it cannot acquire a lock over NFS #7968

Closed
kaysond opened this issue May 3, 2021 · 4 comments
Closed
Milestone

Comments

@kaysond
Copy link

kaysond commented May 3, 2021

Running fish, version 3.1.2 on Ubuntu 20.04.

This is somewhat related to #685. I have my home directory set up on nfs. I rebooted the nfs server and lost some sysctl parameters that set the nlockmgr ports to something my firewall would allow. The result being that locks cannot be acquired.

When running fish, it would hang indefinitely. Checking strace, I could see that it would just sit on an flock call on fish_variables. Took half a night to debug and figure out what the heck was going on. It would be nice if fish failed gracefully.

The other challenge was fish didn't provide any error message, even with --debug='complete,*history*' --init-command='set fish_trace on' options set.

@faho
Copy link
Member

faho commented May 3, 2021

Please upgrade to 3.2.2 via our ppa and try again.

@zanchey
Copy link
Member

zanchey commented May 3, 2021

I'm not sure if changing fish to call flock with LOCK_NB would help - it all sounds highly platform-dependent and the only way to be sure would be to interrupt the call in lock_uvar_file/check_duration with a timer signal, which may potentially introduce other issues.

@kaysond
Copy link
Author

kaysond commented May 3, 2021

So on nfs v4, it seems to work fine with 3.2.2 It appears this version does not try to lock fish_variables at all, so it doesn't exhibit the problem.

openat(AT_FDCWD, "/home/administrator/.config/fish/fish_variables", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=1485, ...}) = 0
read(4, "# This file contains fish univer"..., 4096) = 1485
read(4, "", 4096)                       = 0
close(4)

Going back to nfs v3, with 3.2.2, I can launch fish just fine now, but running any command causes it to freeze, appearing to get stuck on futex(0x55b983943420, FUTEX_WAIT_PRIVATE, 2, NULL

ridiculousfish added a commit to ridiculousfish/fish-shell that referenced this issue May 10, 2021
@ridiculousfish
Copy link
Member

With 91a4059 we no longer attempt to flock history or universal variable files if they are on a remote filesystem. This should prevent hanging if the lock server is missing or stuck.

@ridiculousfish ridiculousfish added this to the fish 3.3.0 milestone May 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants