From 17cc86c1e5454e6f77cebcb5c55836279a85f9f9 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Wed, 31 Jan 2024 16:02:22 -0300 Subject: [PATCH] fix(shell): deadlock on read line error port from https://github.com/tauri-apps/tauri/pull/8539 --- .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 000000000..0e2e68708 --- /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 b797be7e6..fdb268970 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; } } }