Skip to content

v1.4.1

Choose a tag to compare

@harper-joseph harper-joseph released this 06 Jul 17:04
6f13bea

@harperfast/prerender-browser v1.4.1

Two worker-resilience fixes surfaced while load-testing the multi-process render-service
supervisor in Docker. No API changes for existing callers.

Fixes

  • Survive render failures (the blocker). RenderWorker.run() logged render rejections with
    this.render(job).catch(logger.error) — a pino method passed unbound, so on any render
    failure the catch itself threw (Cannot read properties of undefined (reading 'Symbol(pino.msgPrefix)')), turning a logged failure into an unhandledRejection that killed
    the worker
    (a crash loop under the supervisor). Now wrapped:
    .catch((err) => logger.error({ err }, 'failed to render job')). Verified live in Docker — a
    browser-launch failure is now logged and the worker stays up.

  • Graceful SIGTERM drain. Previously SIGTERM/SIGINT just setTimeout(exit, 1000), dropping
    every in-flight render (a job leaves Harper's queue at claim time and is only posted back at the
    end of render(), so each rolling deploy lost claimed-but-unfinished jobs until their TTL
    re-queued them). Now RenderWorker.shutdown() stops the queue consumer (abortable, so it doesn't
    wait out the idle poll), drains in-flight renders (Promise.allSettled, bounded by a deadline),
    then tears down. ErrorHandler drains via an optional onTerminate hook wired from
    startWorker, with a hard backstop before the supervisor's SIGKILL grace.

Notes

  • No breaking changes; ErrorHandler options are optional. 20/20 tests pass.
  • dist/ is built at release time (gitignored); the tarball workflow runs npm run build.

Consuming

"@harperfast/prerender-browser": "https://github.com/HarperFast/prerender-plugin/releases/download/v1.4.1/harperfast-prerender-browser-1.4.1.tgz"