run onComplete inline always#190
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
47efed5 to
7821e0b
Compare
commit: |
| // Fall through and schedule complete instead (without running onComplete inline) | ||
| // Fall through and schedule complete instead | ||
| } | ||
| await ctx.scheduler.runAfter(0, internal.complete.complete, { |
There was a problem hiding this comment.
I wonder if we should save the scheduled job id somewhere so that recovery can look it up if complete failed for an un-catchable reason (e.g. too many reads).
520d751 to
4e922a7
Compare

Instead of doing inline/inline -> schedule/schedule, let's do inline/inline -> schedule/inline, always running the onComplete handler inline in complete.ts so that the scheduler doesn't balloon with OCC-ing / retrying onComplete handlers while the workpool charges ahead.
Also write failed onComplete handlers for investigation / recovery purposes - though it'll be missing the full return value for now.
For un-catchable errors (e.g. the onComplete reads too much data) I think it would still wedge the workpool - but that's pre-existing and a bit orthogonal here