Skip to content

Commit

Permalink
fix(core): Command::output suspend while wait for response (#8539)
Browse files Browse the repository at this point in the history
* fix: Command::output suspend while wait for response

* add change file

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
  • Loading branch information
3 people authored Feb 1, 2024
1 parent 8ce51ce commit cc3d8e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-command-spawn-deadlock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch:bug
---

Fixes a deadlock when reading a stdout or stderr line returns an error.
1 change: 1 addition & 0 deletions core/tauri/src/api/process/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ fn spawn_pipe_reader<F: Fn(String) -> CommandEvent + Send + Copy + 'static>(
Err(e) => {
let tx_ = tx.clone();
let _ = block_on_task(async move { tx_.send(CommandEvent::Error(e.to_string())).await });
break;
}
}
}
Expand Down

0 comments on commit cc3d8e7

Please sign in to comment.