fix(#113): 120s timeout hang in /auth/extract due to unread stderr pipe - #126
fix(#113): 120s timeout hang in /auth/extract due to unread stderr pipe#126lekt9 wants to merge 3 commits into
Conversation
Request-scoped arenas passed by callers are freed when the HTTP request completes. Buffering raw arena pointers in event_buf.owner caused dangling references when a later har/stop request tried to drain and free those events. push() now dupes the event data into the long-lived event_buf allocator and frees the caller's copy immediately. Adds regression test that simulates the exact failure scenario: events buffered under arena A remain readable and correctly freed after arena A is torn down and arena B reads the buffer. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… field fixed - Press action resolves ref to objectId and calls focus() before dispatching Input.dispatchKeyEvent, so key events reach the intended element rather than whatever is currently focused (or nothing) - Key text field is now empty for non-printable keys like Enter/Escape/Tab; only single printable characters (0x20-0x7e) carry text, preventing literal key-name strings from being inserted into focused inputs - Fill action already used nativeInputValueSetter (Object.getOwnPropertyDescriptor) for React/Vue compat; adding tests to cover route param parsing for both actions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tderr pipe When sqlite3 writes enough data to stderr (e.g. "unable to open database file"), the stderr pipe buffer fills and the child process blocks waiting for a reader. Meanwhile readToEndAlloc on stdout also blocks waiting for the child to exit — causing a deadlock that surfaces as a ~120s OS-level timeout. Fix: set stderr_behavior = .Ignore so the child's stderr goes to /dev/null and can never block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
justrach
left a comment
There was a problem hiding this comment.
Approved ✅
Clean, surgical fix for a real deadlock. The root cause analysis is correct:
sqlite3writes to stderr → pipe buffer fills (64KB) → child blocks on write → parent blocks on stdout read → 120s OS timeout- Fix:
stderr_behavior = .Ignoresends stderr to/dev/null
This is the standard fix for unread stderr pipes in child processes. No concerns.
Note: This will need a trivial rebase since router.zig has grown, but the change is in handleAuthExtract which is far from the conflict zones.
|
Can you update this PR to build and test against Zig |
|
Heads up: the diff on this PR doesn't match the title. The title says "fix(#113): 120s timeout hang in /auth/extract due to unread stderr pipe", but the diff is the EventBuffer cross-arena fix (touches Also, looking at
|
Summary
handleAuthExtractspawned a childsqlite3process withstderr_behavior = .Pipebut never read from the stderr pipereadToEndAllocon stdout then also blocks waiting for the child to exit — classic pipe deadlock surfacing as a ~120s OS-level timeoutstderr_behavior = .Ignoreso stderr goes to/dev/nulland can never blockTest plan
zig build)zig build test)GET /auth/extract?browser=chromewhen Chrome Cookies DB is locked/missing — should return quickly with{"cookies":[]}instead of hanging 120s🤖 Generated with Claude Code