Skip to content

bug-report-py 3.0.2: the proxy never sends Connection: close; a short body is a 502 - #30

Merged
kenatleap merged 1 commit into
mainfrom
fix/proxy-keepalive
Nov 15, 2026
Merged

kenatleap merged 1 commit into
mainfrom
fix/proxy-keepalive

Conversation

@kenatleap

Copy link
Copy Markdown
Collaborator

Symptom (seal, live, 2026-11-15): 8 of 10 screenshots in seal's new Bugs page were broken images. The proxy crashed with IncompleteRead(229140 bytes read, 532299 more expected) and returned 500.

Cause (probed from inside the seal container): Azure Container Apps' internal ingress cuts a large response short when the request carries Connection: close. The same request to leaphq-reports gave:

  • keep-alive: 761,439 of 761,439 bytes, 3 times out of 3;
  • Connection: close: 65 KB, 229 KB and 106 KB, 3 times out of 3.

urllib, which the proxy used, always sends Connection: close.

Ruled out first:

  • gunicorn: a localhost request inside the service's container got the whole file, and the sync worker behaved like gthread;
  • the ingress transport setting (http vs auto);
  • peer encryption, which is off.

Fix:

  • The proxy goes out over http.client, which sends HTTP/1.1 keep-alive and follows no redirects, as before.
  • A body that still arrives short becomes a 502 with the byte counts logged, never a crash or a short 200.

Tests (T4), both failing on the old urllib proxy:

  • the forwarded request never says Connection: close;
  • a server that promises 100 KB and sends 1 KB gives a 502.

Suites, all passing: Python 351, CLI 7, e2e 96.

Tag backends-v3.0.2 after merge.

🤖 Generated with Claude Code

…nnection; a short body is a 502

Azure Container Apps' internal ingress cuts a large response short when the request
says Connection: close, which urllib always sends: a 761 KB screenshot through seal's
proxy arrived as 65-311 KB, 3 of 3; without the header, whole, 3 of 3 (2026-11-15).
The proxy goes out over http.client; IncompleteRead becomes a 502. Both new tests
fail on the urllib proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kenatleap
kenatleap enabled auto-merge (squash) November 15, 2026 01:38
@kenatleap
kenatleap merged commit 3c1fc85 into main Nov 15, 2026
1 check passed
@kenatleap
kenatleap deleted the fix/proxy-keepalive branch November 15, 2026 01:41
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