From 18ae2ccc8e9461892c1bd6aff3d4ef0374ed82f2 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 23 May 2021 19:02:42 -0700 Subject: [PATCH] window: log/retry self-pipe-writes At the bottom of https://github.com/wez/wezterm/issues/815 is some discussion about an apparent hang. Let's make the self pipe writing a bit more robust and log to see if that might be related. --- window/src/spawn.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/window/src/spawn.rs b/window/src/spawn.rs index a34ece493..979ce9339 100644 --- a/window/src/spawn.rs +++ b/window/src/spawn.rs @@ -154,7 +154,13 @@ impl SpawnQueue { use std::io::Write; self.queue_func(f, high_pri); - self.write.lock().unwrap().write(b"x").ok(); + while let Err(err) = self.write.lock().unwrap().write(b"x") { + if err.kind() == std::io::ErrorKind::Interrupted { + continue; + } + log::warn!("Failed to signal spawn queue pipe: {:#}", err); + break; + } } fn run_impl(&self) -> bool {