From 219f93a83121dc4c4067bea9c2698bd7ef03190f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Mon, 27 Jul 2026 15:08:26 +0000 Subject: [PATCH] music sidecar: raise Bun.serve idleTimeout (blocking reindex outran 10s default) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The one-time v1→v2 full rebuild (and long range/SSE reads) take far longer than Bun.serve's default 10s request idle-timeout, which dropped the triggering request mid-flight ("request timed out after 10 seconds"). Set idleTimeout: 255 (Bun's max). A build that still outruns it completes in the background regardless — a closed socket doesn't cancel the in-flight build promise. Co-Authored-By: Claude Opus 4.8 --- src/servers/sidecar/music/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/servers/sidecar/music/index.ts b/src/servers/sidecar/music/index.ts index 90917117..1f5a73df 100644 --- a/src/servers/sidecar/music/index.ts +++ b/src/servers/sidecar/music/index.ts @@ -74,6 +74,10 @@ const port = getFreePort(); const server = Bun.serve({ port, hostname: '127.0.0.1', + // A blocking /reindex (esp. the one-time full rebuild) and long range/SSE reads far outlast Bun's + // default 10s request idle-timeout, which would drop them mid-flight. 255s is Bun's max; a build that + // still outruns it completes in the background anyway (the promise isn't cancelled by a closed socket). + idleTimeout: 255, async fetch(req) { const url = new URL(req.url); const json = (data: unknown, init?: ResponseInit) =>