Skip to content

fix: swallow client-disconnect errors in JSON response writer#10

Merged
chodeus merged 1 commit intomainfrom
claude/fix-deletion-connection-error-BKQSv
Apr 17, 2026
Merged

fix: swallow client-disconnect errors in JSON response writer#10
chodeus merged 1 commit intomainfrom
claude/fix-deletion-connection-error-BKQSv

Conversation

@chodeus
Copy link
Copy Markdown
Owner

@chodeus chodeus commented Apr 16, 2026

Summary

  • Wrap WebUIHandler._json_response header/body writes in a try/except for ConnectionResetError and BrokenPipeError.
  • Eliminates the noisy [Errno 104] Connection reset by peer traceback that surfaced after long-running /api/delete calls (Lidarr deletion workflows can take 90+ seconds, during which the browser often times out or navigates away).
  • Purely cosmetic: the server-side deletion already completed successfully (Lidarr delete complete: 18 files deleted across 12 albums); only the unsent reply was lost.

Test plan

  • Trigger a multi-album Lidarr deletion and confirm no traceback is logged even if the browser tab is closed mid-request.
  • Normal short requests (/api/auth-status, /api/login, etc.) still return their JSON bodies unchanged.

https://claude.ai/code/session_01CgFVz9atieqZfC5oiUnTKt

Long-running endpoints like /api/delete can take 90+ seconds during
Lidarr deletion workflows. If the browser times out or navigates away
before the response is written, the wfile.write / end_headers calls
raise ConnectionResetError / BrokenPipeError, producing a noisy
traceback even though the server-side work completed successfully.

Wrap the response write in a try/except for those two exceptions so
the log stays clean when the client hangs up early.

https://claude.ai/code/session_01CgFVz9atieqZfC5oiUnTKt
@chodeus chodeus merged commit e5e69ba into main Apr 17, 2026
4 checks passed
@chodeus chodeus deleted the claude/fix-deletion-connection-error-BKQSv branch April 17, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants