fix(stream-processor): replace unsafe abort with graceful join to drain events
This commit is contained in:
parent
578a898418
commit
385b1b0427
1 changed files with 9 additions and 3 deletions
|
|
@ -164,9 +164,15 @@ impl StreamProcessor {
|
|||
// 6. Attendre la fin du processus avec timeout
|
||||
let result = timeout(self.job_timeout, child.wait()).await;
|
||||
|
||||
// Arrêter le monitoring
|
||||
monitor_handle.abort();
|
||||
event_handle.abort();
|
||||
// Attendre la fin gracieuse du monitoring (drain events)
|
||||
// Si le processus est fini, stderr est fermé, donc monitor_handle va finir
|
||||
// Ce qui droppera le sender, et donc event_handle finira aussi.
|
||||
if let Err(e) = monitor_handle.await {
|
||||
tracing::warn!("Monitor handle join error: {}", e);
|
||||
}
|
||||
if let Err(e) = event_handle.await {
|
||||
tracing::warn!("Event handle join error: {}", e);
|
||||
}
|
||||
|
||||
// 7. Gérer le résultat
|
||||
match result {
|
||||
|
|
|
|||
Loading…
Reference in a new issue