Runtime: wait for notify events to send#1390
Merged
josephjclark merged 2 commits intorelease/nextfrom Apr 24, 2026
Merged
Conversation
We added an async await to ensurePayloadSize a little while ago, but the runtime doens't actually wait for this. It's plausble that while waiting for a payload to be calculated, a step could finish and trigger the complete event early
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Description
This PR ensures that when the runtime publishes an event, like run:start, it awaits the publication before carrying on.
This might address #1072 but I'm not sure, I don't have a local repro
I can't really line it up in my head. If
run:startis published and processed async, then the runtime might complete a step quickly and publishrun:completebefore therun:startprocessed. But the start event still went on the stack before the publish event. I suppose it might yield and let the complete event through first.But in the case I'm looking at, the start event has tiny payload, the step takes a few SECONDS to actually run, and then the complete payload was very large and got redacted. So I can;'t believe that step complete just won the race. Also it looks from the logs like the start event doesn't get published AT ALL.
So this might help some cases. Certainly feels like the right thing to do. Not sure it'll close the issue.
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy