Repository navigation
fix(streaming): make StreamHandle execution mode explicit and fix idle-worker reservation - #227
Merged
MisterVVP merged 1 commit intoAug 27, 2026
Conversation
MisterVVP
merged commit Aug 27, 2026
300663c
into
dev-implement-reusable-synchronous-stream-worker-executor-jskguk
19 checks passed
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.
Motivation
StreamHandle::Cancel()inferred executor-backed execution fromworker_.joinable()leading to waits that never complete after the owned worker was joined, andStreamWorkerExecutor::Submit()could observe the same idle worker multiple times and overcommit a single idle worker.Description
ExecutionMode(enum) onStreamHandleand initialize/preserve it on construction and moves, and use it to decide whether to wait onState::completion_conditioninstead of inferring fromstd::thread::joinable(); this makes repeatedCancel()idempotent and avoids the gRPC destructor/blocking deadlock. (changes ininclude/a2a/client/client.handsrc/client/client.cpp).StreamWorkerExecutorby decrementingidle_workers_onSubmit()when assigning a pending task to an idle worker and removing a redundant decrement in the worker loop so each idle worker is reserved for at most one submitted task. (change insrc/client/stream_worker_executor.cpp).Cancel()on gRPC streams to prevent regressions. (change intests/unit/grpc_transport_test.cpp).include/a2a/client/client.h,src/client/client.cpp,src/client/stream_worker_executor.cpp, andtests/unit/grpc_transport_test.cpp.