From 15dc7060e8828d52081a2071c7550bcc957eb70b Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Thu, 1 Feb 2024 00:01:23 -0300 Subject: [PATCH] fix(shell): deadlock on read line error (#923) --- .changes/fix-cmd-spawn-deadlock.md | 5 +++++ plugins/shell/src/process/mod.rs | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changes/fix-cmd-spawn-deadlock.md diff --git a/.changes/fix-cmd-spawn-deadlock.md b/.changes/fix-cmd-spawn-deadlock.md new file mode 100644 index 00000000..0e2e6870 --- /dev/null +++ b/.changes/fix-cmd-spawn-deadlock.md @@ -0,0 +1,5 @@ +--- +"shell": patch +--- + +Fixes a deadlock when reading a stdout or stderr line returns an error. diff --git a/plugins/shell/src/process/mod.rs b/plugins/shell/src/process/mod.rs index b797be7e..fdb26897 100644 --- a/plugins/shell/src/process/mod.rs +++ b/plugins/shell/src/process/mod.rs @@ -385,6 +385,7 @@ fn spawn_pipe_reader) -> CommandEvent + Send + Copy + 'static>( block_on_task( async move { tx_.send(CommandEvent::Error(e.to_string())).await }, ); + break; } } }