A 27-byte telemetry response nobody reads freezes Claude Desktop every two days ...
HN Best 200 @best
A 27-byte telemetry response nobody reads freezes Claude Desktop every two days blog.dfb.sh · 9 points · 1 comments · HN thread
TL;DR The author traces Claude Desktop's freezes on Linux, which happen every couple of days, to a file descriptor leak in Electron/Chromium. Fire-and-forget POST requests to Claude's Code presence endpoint leave their unread 27-byte no-store responses holding shared-memory descriptors; after about 1000 accumulate the renderer runs out of fds and its IPC stalls. The post covers the debugging path, the Chromium behaviour, a one-line workaround, and two bug reports that were closed.
- Claude Desktop froze every day or two; the renderer's main thread was blocked waiting on an IPC reply stuck behind a message that arrived without its file descriptor.
- Core dump analysis found 942 2 MiB shared-memory regions, 938 holding only the 27-byte body {"refresh_after_seconds":0}, from the app's presence 'clear' requests.
- The requests use fetch with keepalive:true and never read the body; Chromium buffers no-store bodies lazily, so each unread response keeps its data pipe fd open.
- The renderer's soft RLIMIT_NOFILE is 1024, so roughly 1000 leaked descriptors exhaust it; Chromium 152 hangs silently instead of failing the fetch.
- Chromium closed bug 582417463 as a duplicate of 378822137 (assigned, P3); a fix in Chrome 154 makes the renderer exit cleanly rather than hang, but the page still gets no error.
- Workaround: call r.body?.cancel() on the response, or use navigator.sendBeacon; Anthropic's GitHub issue was closed by a bot as not related to Claude Code.
Discussion The thread is minimal: a single comment, 'Excellent debugging!', on a submission with 9 points. There is no broader discussion of the bug, the Chromium behaviour, or the workaround.
- Praise for the debugging work (most): The only comment is a short compliment on the depth of the investigation. No other views were expressed.
#Electron #Chromium #fileDescriptors #ClaudeDesktop #debugging #Linux