Repository navigation
Add async asset state store accessors for async tasks and watchers - #71354
Closed
desusaiteja wants to merge 1 commit into
Closed
desusaiteja wants to merge 1 commit into
desusaiteja wants to merge 1 commit into
Conversation
…ggers Watcher triggers run on the triggerer's shared event loop and async tasks on the worker's, but the asset state store only offered synchronous accessors that block the loop on every supervisor round-trip — stalling every other trigger or coroutine. Task state store gained async accessors in apache#68232; this closes the same gap for asset state store.
Member
|
Closing this. #72127 added |
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.
The asset state store only offers synchronous get/set/delete/clear. These block the event loop on every supervisor round-trip, which stalls other coroutines in async tasks and, for watcher triggers, every other trigger sharing the triggerer loop. The watcher trigger example in the docs was itself calling the blocking accessors inside async def run().
#68232 solved the same problem for the task state store. Instead of the direct async HTTP client path proposed in the issue, it awaits the supervisor round-trip via SUPERVISOR_COMMS.asend(), so nothing blocks the loop and no extra client wiring is needed at task startup. This PR extends that pattern to the asset state store:
With this and #68232, every state store accessor has a non-blocking path. The remaining idea from the issue, bypassing the supervisor with a direct async HTTP client, may not be needed given the asend() approach, so leaving that call to the maintainers.
related: #66842
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines