From 6c9384caabf5414b7135a660de20c9e4cb50fac3 Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Fri, 16 Oct 2026 23:18:39 +0900 Subject: [PATCH] fix(recording): write segment start times off the async runtime The start-time persister wrote the file and ran two fsyncs inside its tokio task, blocking a runtime worker that capture pipelines also use. The write now runs on a blocking thread. --- crates/recording/src/studio_recording.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/recording/src/studio_recording.rs b/crates/recording/src/studio_recording.rs index 762ae485795..60ed1c6e944 100644 --- a/crates/recording/src/studio_recording.rs +++ b/crates/recording/src/studio_recording.rs @@ -1496,7 +1496,15 @@ impl Pipeline { firsts[3], ); if written != Some(times) { - match write_segment_start_times(&segment_dir, ×) { + // A blocking write and two fsyncs: keep them off the + // runtime workers the capture pipelines run on. + let dir = segment_dir.clone(); + let result = tokio::task::spawn_blocking(move || { + write_segment_start_times(&dir, ×) + }) + .await + .unwrap_or_else(|error| Err(std::io::Error::other(error))); + match result { Ok(()) => written = Some(times), Err(error) => { failed_writes += 1;