3 ms·
For anyone who was wondering, I found a post explaining why threads can be in "uninterruptible sleep" in the first place: https://eklitzke.org/uninterruptible-
by amelius 7y ago
For anyone who was wondering, I found a post explaining why threads can be in "uninterruptible sleep" in the first place:
https://eklitzke.org/uninterruptible-sleep https://eklitzke.org/uninterruptible-sleep
- gravitas 7y agoOn this article, one of the tricks you can do to avoid the hung NFS client reboots is to quickly alias the NFS server IP onto the local device (ip addr add ...). This basically causes the networking layer to act like the NFS server went away but also return a RST (reset) network packet to that effect, allowing the failure to propagate upwards to the rest of the stack and unhang.
- jmiserez 7y agoUnplugging the ethernet cable usually also works.
- the8472 7y agoyou could also mount nfs with soft timeouts which won't wait forever and instead return an error to userspace.
- Spivak 7y agoWhich is a very good practice if you're in control of the software receiving the error. But so much freaking software doesn't handle this correctly it's maddening and so sleep everything that touches it is the only safe thing to do.
- GauntletWizard 7y agoFor some network filesystems, I want to mount them "Kill every process with a filehandle open to this on error". Is there a way to do that?
- the8472 7y agoNFS has been converted to to the TASK_KILLABLE mentioned elsewhere in the comments, so you could scan for threads stuck in this state, scan proc for open file descriptors pointing to the network filesystems and then kill those processes. That of course doesn't work if you're dealing with a filesystem that still uses TASK_UNINTERRUPTIBLE
- pram 7y agoYeah if you've ever used NFS you're well acquainted with this scenario lol
- mehrdadn 7y agoThis isn't a UNIX thing, it happens on Windows too. See non-alertable kernel-mode waits in [1], [2]. [1] https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-kewaitforsingleobject https://docs.microsoft.com/en-us/windows-hardware/drivers/dd... [2] https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/waits-and-apcs https://docs.microsoft.com/en-us/windows-hardware/drivers/ke...