-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compat flag for queue consumers to not block on waitUntil'ed work #3596
base: main
Are you sure you want to change the base?
Conversation
@fhanau ... this will likely impact the scheduling of the |
f97c4f7
to
e207648
Compare
Fixed up the code to implement the decisions for the two questions above. There's a lot of test coverage in the corresponding internal PR, so from my perspective this is good to go. |
|
e207648
to
c96dc1e
Compare
Ok, looks like it was just the one line that the linter was unhappy with -- it's passing now. So this just needs review from someone on the runtime team, since @jbwcloudflare doesn't count. |
c96dc1e
to
e462427
Compare
The intent is that the event can be considered done when the queue() handler's returned promise resolves, allowing acked/nacked message info to be returned back to the queues infrastructure sooner, rather than requiring all waitUntil'ed work to finish first. This has two important benefits: 1. This will keep consumer invocations from getting slowed down by slow/hung waitUntil'ed tasks. 1. This will keep consumer invocations from failing due to failing waitUntil tasks. This commit does not implement the new functionality, just adds the flag and adds the logic to read the flag where needed. The actual implementation will come in the next commit for easier review.
18a6a4c
to
a796f1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'd like to see some additional code comments explaining the code flow a bit more. With the promise chains it becomes a bit obtuse very quickly
f630f72
to
673dec1
Compare
Thanks for the review! |
673dec1
to
9cd8c0f
Compare
The intent is that the event can be considered done when the
queue() handler's returned promise resolves, allowing acked/nacked
message info to be returned back to the queues infrastructure sooner,
rather than requiring all waitUntil'ed work to finish first. This has
two important benefits:
slow/hung waitUntil'ed tasks.
waitUntil tasks.
This notably makes queue() handlers behave more like fetch() handlers, which should make them more intuitive for most users.