Skip to content

Record Playwright socket diagnostics during public release checks - #4604

Merged
max-sixty merged 2 commits into
mainfrom
diagnose/issue-4521
Oct 28, 2026
Merged

max-sixty merged 2 commits into
mainfrom
diagnose/issue-4521

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

The hosted journey's recurring connection reset can occur without a matching Worker invocation. Capture the client half of that boundary during publish-site's public verification and journey: UTC timestamps, socket reuse and lifecycle, peer addresses/ports, TLS negotiation, request durations, response status and Cloudflare ray IDs. Records use component=leaf-http-transport in the existing job log.

This preloads a Node diagnostics-channel subscriber into Playwright's driver only for the public verification step. It omits request URLs, bodies, credentials and general header dumps; the sole retained response header is a shape-checked cf-ray. Requests keep their existing failure and retry behavior.

Validated with uv run pytest dev/tests/model/test_http_transport.py -q -n0: the real Playwright driver reuses a socket, records a successful response's ray, and reports a server-forced ECONNRESET, without logging planted authorization, cookie, path or query secrets. A local HTTPS probe also emitted TLS negotiation records. Focused pre-commit checks pass; Vulture’s existing framework exclusions now include the two http.server attributes the test configures. Reviewed the subscriber and its workflow scope; no product runtime changes.

Refs #4521. This adds evidence for the next recurrence, not a diagnosed repair; the reset's cause remains open. The existing Cloudflare invocation logs provide the server side, while these records cover the previously missing client socket side. The workflow change follows the repository owner's authorization in the issue and remains subject to control-plane owner review.

@max-sixty
max-sixty merged commit 9cf5d82 into main Oct 28, 2026
4 checks passed
@max-sixty
max-sixty deleted the diagnose/issue-4521 branch October 28, 2026 16:21
max-sixty pushed a commit that referenced this pull request Nov 5, 2026
The hosted journey's state poll now retries through up to five
connection resets instead of one, so a short burst of resets between the
runner and Cloudflare's edge no longer fails `publish-site`. This is the
repair @max-sixty chose on #4521.

`read_state` passes a new `STATE_RESET_RETRIES = 5` to Playwright's
native `max_retries`. Playwright retries only `ECONNRESET`, with a
backoff that doubles from 250 ms, so one read keeps going through about
eight seconds of resets. HTTP failures still surface at once through
`answered`, and #4604's socket capture still logs every failed attempt.

Why one retry wasn't enough: in [publish-site run
41876972316](https://github.com/max-sixty/leaf/actions/runs/41876972316),
request 26 reset on a reused socket after 3.1 s. Playwright's retry then
opened a fresh socket, finished the TLS handshake, and reset again after
5.3 s, which used up #4881's single retry. In all three recorded cases
the reset came before Workers Observability logged any request, so
retrying this idempotent GET is safe.

The transport test in `dev/tests/model/test_http_transport.py` now sets
the constant to 1, which keeps its exhausted-retry case inside the model
tier's 3 s budget. It still checks recovery, exhaustion, HTTP 500
without retry, and credential-free capture. It passes locally (3
passed), and ruff is clean.

Closes #4521

Co-authored-by: leaf-agent <[email protected]>
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