Skip to content
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

Fix recently-introduced onAbort() in WorkerEntrypoint::customEvent(). #1803

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Mar 12, 2024

The IoContext will be destroyed during the course of event->run(), at which point this onAbort() will reject with a "PromiseFulfiller destroyed without fulfilling promise" exception. I don't know why this doesn't happen in tests but it seems to happen a lot in prod?

Anyway, I moved the onAbort() handling into the JSRPC CustomEvent implementation, which is the place I needed it for my purposes. I suspect many CustomEvent implementations do not honor onAbort(), though, which will need to be fixed later.

The `IoContext` will be destroyed during the course of `event->run()`, at which point this `onAbort()` will reject with a "PromiseFulfiller destroyed without fulfilling promise" exception. I don't know why this doesn't happen in tests but it seems to happen a lot in prod?

Anyway, I moved the `onAbort()` handling into the JSRPC CustomEvent implementation, which is the place I needed it for my purposes. I suspect many CustomEvent implementations do not honor onAbort(), though, which will need to be fixed later.
@kentonv kentonv merged commit 3541b32 into main Mar 12, 2024
10 checks passed
@kentonv kentonv deleted the kenton/fix-onabort branch March 12, 2024 01:27
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.

3 participants