4 ms·
Also, why can tab-completion in Bash hang my shell?
by amelius 5y ago
Also, why can tab-completion in Bash hang my shell?
- chrsig 5y agoThis is actually an incredibly frustrating thing -- when doing disk i/o, the process goes into an uninterruptible sleep state[0]. So if your shell is doing some tab completion that goes into an uninterruptible sleep, there's no escape sequence you can send it to cancel that operation. Where I've seen this be the most vexing is in AWS if an EBS volume dies (surprisingly more frequent of an occurrence than you'd think!). It effectively prevents the machine from cleanly shutting down, and you wind up having to wait for the instance to be forcefully terminated. [0] https://eklitzke.org/uninterruptible-sleep https://eklitzke.org/uninterruptible-sleep
- amelius 5y agoThis is indeed nasty. Imagine you have a server built using asyncio style multitasking, and one of the tasks tries to do disk i/o ... This basically throws the entire asyncio style programming out of the window.
- chrsig 5y agoindeed. this is one of the benefits of a concurrent sequential processing model with a scheduler. e.g., in Go, blocking syscalls get put on their own thread in a thread pool, so that processing can continue while waiting. I'm sure you can do something similar in a raw event loop, but I don't think the machinery is generally baked in to the io interfaces to do so.
- kelnos 5y agoBecause tab completion often has to do i/o, which can put the shell into an uninterruptible sleep state. I personally see this most when I've left home but I still have an NFS mount (to my NAS at home) under my home directory.