Skip to content

Render service: a local file answered after its render ended is not thrown - #785

Merged
adamjohnwright merged 1 commit into
mainfrom
render/route-already-handled
Nov 4, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
render/route-already-handled

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

With RENDER_FILES set (#777), the page's requests for release files are answered by a Playwright route handler. Playwright runs that handler itself, so nothing awaits its promise. A request still being read when its render had already ended (timed out, its page closed) was "already handled" by the time its file arrived: route.fulfill threw, the rejection was unhandled, and the whole service exited, failing every render in flight.

What changes

  • fromFiles in tools/render/render-core.ts catches a failed fulfill and records it among the render's problems instead of throwing. localAnswer already turns its own read errors into answers, so fulfill is the only thing that can throw here.

Checked

  • New test in tools/render/render-core.spec.ts: a request answered after its render has ended is recorded and never thrown. It fails on main (unhandled rejection) and passes with the fix.
  • Found in a bulk run of about 19,000 figures through a local render service reading release files: the service exited partway through. With the fix, the same run completed with nothing missing.

Belongs to no spec here. It was found by pdf-export's spec 001 (its figures step, research R10).

🤖 Generated with Claude Code

…hrown

With RENDER_FILES set (#777), the page's requests to the download site are
answered by a route handler, which Playwright runs itself. A request still
being read when its render had ended (timed out, its page closed) was
"already handled" when its file arrived; route.fulfill threw, nothing awaited
the handler, and the unhandled rejection ended the whole service. The
handler now catches it and says it among the render's problems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit ec9958a into main Nov 4, 2026
8 checks passed
@adamjohnwright
adamjohnwright deleted the render/route-already-handled branch November 4, 2026 17:55
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.

1 participant