Replies: 5 comments 9 replies
-
|
There is a crate seems useful for this issue. The process wrap crate can wrap a command with multi-process and kill the whole process group. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for reporting this!
This approach sounds reasonable to me! |
Beta Was this translation helpful? Give feedback.
-
|
But what if the user does not want to receive a SIGTERM on Event::Stop? Could we initially just replace SIGKILL by SIGTERM and use SIGKILL if we receive like a third ctrl-c? |
Beta Was this translation helpful? Give feedback.
-
|
How about the following approach:
|
Beta Was this translation helpful? Give feedback.
-
|
Using This creates a new problem: since Possible solutions:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The Issue
The current
dora stopcommand (which usesControlRequest::Stop) depends on theEvent::Stopmechanism to function. While this allows developers to exit gracefully, there are numerous instances where theEvent::Stopsignal goes unhandled.In these unhandled cases, the daemon is designed to kill the process after the
grace_durationexpires. Unfortunately, this force kill rarely works. The process simply hangs, preventing the dataflow from being properly stopped.Root Cause Analysis
Upon investigation, we found the issue is linked to the
--uvflag. We useProcess::killto terminate the process, which by default sends theSIGKILLsignal. When theuvprocess receives this signal, it exits immediately. Consequently, the actual Python nodes it spawned become orphan processes.I tested replacing
SIGKILLwithSIGTERM(the default signal used in Docker), and this resolved the problem. However, it's important to note thatSIGTERMdoes not offer the same termination guarantee thatSIGKILLdoes.Proposal for Mitigation
Given this, should we introduce a three-phase stopping procedure (
Event::Stop -> SIGTERM -> SIGKILL), or would alternative mitigations be more appropriate?Beta Was this translation helpful? Give feedback.
All reactions