Skip to content

feat(server): finish async unary execution with native gRPC callbacks - #317

Merged
MisterVVP merged 5 commits into
feat/async-serverfrom
feat/grpc-async-unary-268
Oct 28, 2026
Merged

MisterVVP merged 5 commits into
feat/async-serverfrom
feat/grpc-async-unary-268

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Completes the remaining PR 3 and PR 4 scope of #268 in one PR, targeting feat/async-server, as requested.

Adds opt-in AsyncGrpcServerTransport for all nine unary RPCs. It connects the existing async engine to native gRPC callbacks, copies metadata/auth, propagates deadlines and cancellation, and queues application execution, stop observers, interceptors, and response finalization on the bounded SDK worker pool. Shared helpers preserve synchronous validation, status/ErrorInfo mapping, extension trailers, and ListTasks conversion.

Adds explicit service shutdown, native lifecycle/concurrency tests, an installed-package consumer example, a platform availability guide, async unary TCK profiles for both stores, and reproducible sync/async thread and latency evidence. Existing synchronous registration remains available. Streaming, HTTP scheduling, outbound clients, and async database I/O remain outside #268.

Older gRPC releases receive the exported stable-callback API opt-in. Installed-package dependency discovery resolves gRPC before a Protobuf fallback, avoiding partial target exports. Request envelopes initialize the operation directly before payload conversion, and the server-deadline test disables the competing client timer.

The test and measurement clients use one explicitly polled completion queue per fixture, keeping client thread counts fixed across both service paths and supporting legacy Windows gRPC. Installed-consumer validation generates only the SDK configuration installed for the test. Windows scratch cleanup is best-effort when build tools retain directory handles; installation, build, and smoke-test errors still propagate. Lifecycle assertions are grouped into focused helpers so Ubuntu's GTest 1.14 macro expansions remain within the lint complexity limit.

Evidence

With two SDK workers and controller-held pending replies, 32/128 concurrent async requests used two application threads in both cases; the equivalent synchronous path used 32/128. Representative loopback p50/p95 values, configurations, limitations, and reproduction commands are in the new guide. The TCK adapter executes the existing synchronous fixture on bounded workers and is explicitly documented as a compatibility fixture.

Testing

  • Canonical A2A_VERIFY_POSTGRES=1 A2A_VERIFY_BUILD_DIR=build ./scripts/verify_changes.sh: 880 tests passed.
  • Repository formatter, exact CI dry-run formatting, and ./scripts/run_clang_tidy.sh build: passed; lint uses a local cache keyed by translation-unit dependencies and tool/configuration inputs.
  • ASan/UBSan: 84 native/async-engine tests passed. ThreadSanitizer: 65 lifecycle/async-engine tests passed.
  • Native deadline-versus-completion boundary race: application replies scheduled before, at, and after the server deadline; verifies exactly-once completion/AfterDispatch and ignores duplicate replies after gRPC teardown and SDK destruction. Passed 30 repetitions (90 RPCs), plus 10 repetitions under ASan/UBSan.
  • Native cancellation/deadline/admission race cases: 30 repetitions passed; the isolated server-deadline case also passed 50 consecutive runs.
  • Clang-tidy 18 with GTest 1.14 system headers passed for the dispatcher tests and native client fixture; the original complexity diagnostics were reproduced before the fix. Isolated Protobuf dependency-order and multi-config installed-consumer checks reproduce the old failures and pass with the fixes.
  • Installed SDK consumer and native example smoke passed; unsupported-library fallback returns CTest skip code 77.
  • Official TCK start/run/stop flow: synchronous in-memory and PostgreSQL each 249 passed / 16 skipped; native async gRPC each 68 passed / 197 skipped due to transport/capability selection.
  • Performance smoke: 54 cases, zero errors. mdBook build and Python/workflow syntax checks passed.
  • pip-audit: no known vulnerabilities. Native OSV scan attempted but blocked by the environment's HTTP 403 policy for api.osv.dev; no dependency versions changed.

The previously authorized TCK baseline exception is retained: the upstream registry reports 80.9% MUST coverage (80.0% overall) because 21 MUST requirements have no upstream tests. All executable tests passed; this is not a claim of complete registered-requirement coverage. Local Linux GCC validation and all required CI checks, including Windows, macOS, sanitizers, conformance, performance, and CodeQL, passed on 768fde3.

Authorship and AI usage

  • Contains substantive content written by a human
  • Contains substantive content generated by an AI agent

Checklist

  • ./scripts/verify_changes.sh passed locally
  • Docs updated if behavior changed

@MisterVVP ready for your review.

@MisterVVP MisterVVP added the AI agent AI agent contribution label Oct 28, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP self-assigned this Oct 28, 2026
@MisterVVP
MisterVVP marked this pull request as draft October 28, 2026 16:40
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T17:16:56.671990Z 1e4d182 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 1e4d182b0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@MisterVVP
MisterVVP marked this pull request as ready for review October 28, 2026 21:23
@MisterVVP
MisterVVP merged commit c784788 into feat/async-server Oct 28, 2026
22 checks passed
@MisterVVP
MisterVVP deleted the feat/grpc-async-unary-268 branch October 28, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI agent AI agent contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant