Skip to content

Commit 03da748

Browse files
bsandu-peridiomobileoverlord
authored andcommitted
fix: replace print_and_exit() with Err(anyhow!(...))
This fixes a deadlock in tui mode, because of tokio task error propagation. Can be reproduced by listing an extension under a runtime, but not defining in the extensions: section. Flow chain before fix: - spawned tokio task (ext build) hits stamp validation failure - calls print_and_exit() → renderer.shutdown() - shutdown() busy-waits with std::thread::sleep(5ms) for the render loop to stop - std::thread::sleep() blocks the tokio thread, preventing the render loop task from running - render loop never sets loop_stopped = true - deadlock — shutdown() spins forever Signed-off-by: Beniamin Sandu <b.sandu@peridio.com>
1 parent e22c773 commit 03da748

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/commands/ext/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ impl ExtBuildCommand {
191191
);
192192

193193
if !validation.is_satisfied() {
194-
validation
195-
.into_error(&format!("Cannot build extension '{}'", self.extension))
196-
.print_and_exit();
194+
let err =
195+
validation.into_error(&format!("Cannot build extension '{}'", self.extension));
196+
return Err(anyhow::anyhow!("{err}"));
197197
}
198198
}
199199

0 commit comments

Comments
 (0)