Repository navigation
feat(server): add coroutine streaming and gRPC reactors - #321
Merged
Merged
Conversation
Extract focused assertion helpers so streaming tests stay within the cognitive complexity limit with CI GoogleTest headers. Poll initial metadata before waiting for server progress in the unread-stream tests, and use the supported minimum HTTP/2 lookahead buffer.
12 tasks
Owner
Author
|
@codex review this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
12 tasks
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Summary
Closes #169.
Adds opt-in coroutine server streaming for
SendStreamingMessageandSubscribeToTaskto the existing Boost.Asio executor and native gRPC callback service. Applications await owned event writes and return a terminal result. Existing synchronous executors, sessions, dispatchers and transport registrations remain source-compatible.AsyncDispatcher::DispatchStreamreuses the [Enhancement]: Add opt-in async unary server execution and cancellation #268 request context, terminal arbitration, admission limits, validation, authentication and interceptors. After hooks run once at stream completion. Shared authorization helpers recheck stored task visibility before each event, and write failures remain authoritative even if an application ignores them.OnWriteDone, permit one outstanding write, deferFinishuntil that write completes, and delete themselves inOnDone. Cancellation/deadlines and host shutdown use the existing request lifecycle. A stalled native write is cancelled so it cannot hold host drain; its application context retains the shutdown outcome while the wire may reportCANCELLED. Pending coroutine cleanup retains its admission reservation. The async path has no blockingNext, watcher, polling or per-stream SDK worker.Authorship and AI usage
Testing
Canonical PostgreSQL-enabled
./scripts/verify_changes.sh: 985 tests passed, zero failures (two expected TLS-without-SUT skips).Exact repository formatting and explicit
./scripts/run_clang_tidy.sh buildwith LLVM 19: passed across 71 production and 89 test/example translation units. The local runner executes the unchanged checks for every translation unit in parallel and reuses successful results only when tool, command, source and header content fingerprints match.Clang 19 AddressSanitizer + UndefinedBehaviorSanitizer: 29 streaming checks passed, including native RPCs, SDK-client interoperability, slow-reader cancellation, non-reading-client host drain, and the independent-thread publication/cancellation race.
ThreadSanitizer: 17 streaming checks passed, without suppressions.
Official TCK start/run/stop flow, both in-memory and PostgreSQL stores:
The coroutine setup executes 15 more tests than the prior unary-only setup. Upstream registry requirements without tests remain explicit coverage gaps; passing executable tests does not claim complete registered-requirement coverage.
Required gRPC + HTTP/JSON performance smoke: 54 scenarios, zero errors.
mdbook build book: passed. Python toolingpip-audit: no known vulnerabilities. Dependency manifests are unchanged.Reproducible c64 evidence
async_stream_execution_evidence 64compares synchronous and coroutine gRPC subscriptions with the same publication core, metadata and two events per stream. Both modes use one channel and synchronous client reads, without adding a client thread per stream. A Linux Debug run using GCC 15.3, gRPC 1.51.1 and Boost 1.92.0 produced:The coroutine completion result meets the 10 ms target for this workload. Measurements include shared-runner scheduling and sequential client draining; they are not a general latency guarantee. The executable and reproduction instructions are included under
tests/andbook/src/server/async-streaming.md.Checklist
./scripts/verify_changes.shpassed locally