Skip to content

Keep workers alive on bad attachments and unreadable sources#397

Open
wuercher wants to merge 1 commit into
LogicLabs-OU:mainfrom
wuercher:fix/worker-crash-on-bad-attachments
Open

Keep workers alive on bad attachments and unreadable sources#397
wuercher wants to merge 1 commit into
LogicLabs-OU:mainfrom
wuercher:fix/worker-crash-on-bad-attachments

Conversation

@wuercher

@wuercher wuercher commented Jul 1, 2026

Copy link
Copy Markdown

pdf2json can throw an unhandled rejection deep in image parsing (e.g. "Bits per component missing in image") that bypasses the pdfParser error events and crashes the indexing worker. As the workers run under concurrently, the crashed worker is not restarted and all indexing silently halts while emails keep being archived.

  • Re-enable the safety timeout in extractTextFromPdf so a hung parse resolves empty instead of leaving the promise (and the indexing job) pending forever.
  • Add unhandledRejection/uncaughtException guards to the indexing and ingestion workers so a single bad attachment, or an unreadable/locked source file (EACCES ReadStream error), cannot take the whole worker down.

Fixes #398

pdf2json can throw an unhandled rejection deep in image parsing (e.g.
"Bits per component missing in image") that bypasses the pdfParser error
events and crashes the indexing worker. As the workers run under
concurrently, the crashed worker is not restarted and all indexing
silently halts while emails keep being archived.

- Re-enable the safety timeout in extractTextFromPdf so a hung parse
  resolves empty instead of leaving the promise (and the indexing job)
  pending forever.
- Add unhandledRejection/uncaughtException guards to the indexing and
  ingestion workers so a single bad attachment, or an unreadable/locked
  source file (EACCES ReadStream error), cannot take the whole worker down.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

Indexing worker crashes on a malformed PDF attachment (pdf2json "Bits per component missing in image") → all indexing silently halts

2 participants