Respect abort signals in asset preprocessing worker#2179
Respect abort signals in asset preprocessing worker#2179MohamedBassem wants to merge 1 commit intomainfrom
Conversation
|
Warning Rate limit exceeded@MohamedBassem has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 24 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const ret = await Promise.race([ | ||
| worker.recognize(buffer), | ||
| abortPromise(abortSignal), | ||
| ]); |
There was a problem hiding this comment.
Prevent abort race from causing unhandled rejection
In readImageText the abort handling races worker.recognize against abortPromise, but the abort promise is left pending when OCR wins the race. If the job’s abort signal fires later (e.g., the queue timeout or a manual cancellation after OCR completed), that pending promise will reject with no catch handler, producing an unhandled rejection and potentially taking down the worker process under Node’s default unhandledRejection behavior; the same pattern also exists in the PDF screenshot race. The abort promise needs to be cancelled or observed so late aborts don’t crash the worker.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task