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

Rethrow abort exception on IoContext::run #3699

Merged
merged 1 commit into from
Mar 12, 2025
Merged

Conversation

ObsidianMinor
Copy link
Contributor

We're seeing errors getting reported from actors trying to run promises without an active request. We've determined this is from tasks trying to run after an actor's IO context has been aborted. This change stores the abort exception in the IoContext and rethrows it in IoContext::run.

Verified

This commit was signed with the committer’s verified signature.
dvandersluis Daniel Vandersluis
We're seeing errors getting reported from actors trying to run promises
without an active request. We've determined this is from tasks trying to
run after an actor's IO context has been aborted. This change stores the
abort exception in the `IoContext` and rethrows it in `IoContext::run`.
@ObsidianMinor ObsidianMinor requested a review from kentonv March 11, 2025 23:02
@ObsidianMinor ObsidianMinor requested review from a team as code owners March 11, 2025 23:02
@ObsidianMinor ObsidianMinor requested a review from tewaro March 11, 2025 23:02
@anonrig
Copy link
Member

anonrig commented Mar 12, 2025

Can we add a test to not regress in the future?

@ObsidianMinor
Copy link
Contributor Author

Can we add a test to not regress in the future?

Maybe...? It'd have to be incredibly hacky since this is just turning an assertion failure that was only observable as a log message into another log message that isn't reported as an internal error...

@ObsidianMinor
Copy link
Contributor Author

I'll continue looking into adding a test for this but I don't think it's worth blocking since this is one of our highest recorded issues.

@ObsidianMinor ObsidianMinor merged commit c03a25b into main Mar 12, 2025
16 of 17 checks passed
@ObsidianMinor ObsidianMinor deleted the fix/abort-ex-on-run branch March 12, 2025 05:40
@@ -336,6 +336,7 @@ class IoContext final: public kj::Refcounted, private kj::TaskSet::ErrorHandler

// Force context abort now.
void abort(kj::Exception&& e) {
abortException = kj::cp(e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues:

  1. Probably this should not overwrite the exception if abort() is called twice.
  2. There is at least one place in the code where we call abortFulfiller->reject directly rather than calling this abort method. We should probably change it to call this abort().

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.

None yet

4 participants