Daemon: Ignore interrupts between accept() and child start#502
Conversation
Sending SIGINT to the nix-daemon parent process is supposed to stop the parent, not the children. So any connection that has been accept()ed should continue normally. However, there is a time window between the call to accept() and the fork() of the child where we could receive SIGINT, which would cause the child to throw an "Interrupted" exception. This shows up in the client as error: cannot open connection to remote store 'daemon': read of 32768 bytes: Connection reset by peer Solution: don't call checkInterrupts() after accept(), and clear the interrupt flag in the child process.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughTwo targeted interrupt-handling fixes in the Unix socket layer: a redundant ChangesUnix Socket Interrupt Handling
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Motivation
Sending SIGINT to the nix-daemon parent process is supposed to stop the parent, not the children. So any connection that has been
accept()ed should continue normally. However, there is a time window between the call toaccept()and thefork()of the child where we could receive SIGINT, which would cause the child to throw anInterruptedexception. This shows up in the client asSolution: don't call
checkInterrupts()afteraccept(), and clear the interrupt flag in the child process.Context
Summary by CodeRabbit
Bug Fixes
Chores