Repository navigation
fix: report unexpected performance_sut exits and per-scenario wire health checks - #271
Conversation
### Motivation - Intermittent failures in the gRPC/inmemory performance coordinate (IdleStream_ClientCancellationLatency) pointed to a nondeterministic lifecycle/cancellation race where the server SUT could exit unexpectedly under concurrent client cancellations. - The root cause was that some ServerStreamSession implementations block in `Next()` while a separate cancellation watcher thread polls `::grpc::ServerContext::IsCancelled()`, producing cross-thread cancellation churn and delayed server retirement under load. - Make gRPC handlers observe cancellation on the gRPC handler thread for sessions that can support interruptible timed reads to avoid cross-thread Cancel() races while preserving compatibility for blocking sessions. ### Description - Add `SupportsTimedNext()` to `ServerStreamSession` with a `false` default and document its purpose to advertise interruptible timed reads. - Implement `SupportsTimedNext()` override returning `true` for the task-subscription `SubscriptionSession` so it advertises timed-read capability. - Update gRPC streaming handlers in `GrpcServerTransport` to: prefer `NextFor(kStreamCancellationPollInterval)` when `SupportsTimedNext()` is true, and only create a `StreamCancellationWatcher` fallback when a session does not support timed reads; also skip empty non-terminal results rather than treating them as end-of-stream. - Add a unit assertion that subscription sessions report `SupportsTimedNext()` in `tests/unit/task_subscription_service_test.cpp`. ### Testing - Ran formatting and validation: `./scripts/run_clang_format.sh` and `clang-format --dry-run --Werror` on tracked sources (passed). - Full build and test suite: executed the repository build and ran `ctest` (574 tests) with all tests passing (574/574 passed). - Performance validation: ran focused reproduction `A2A_PERF_TRANSPORTS=grpc A2A_PERF_STORE_BACKENDS=inmemory A2A_PERF_REQUESTS=1000 A2A_PERF_CONCURRENCY=16 A2A_PERF_SCENARIOS=IdleStream_ClientCancellationLatency ./scripts/run_performance_tests.sh` three times and observed zero errors each run. Also ran the mandatory performance smoke check and it reported zero errors. - Linters: ran `./scripts/run_clang_tidy.sh build` and `clang-tidy` on the changed test file; changed production and test code passed the targeted clang-tidy checks (the full repository lint run was performed but its default profile was large and lengthy; changed files were validated). --------- Co-authored-by: Vladimir Pavlov <[email protected]>
|
@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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e68589de9f
ℹ️ 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".
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d6096a2a1
ℹ️ 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".
|
@codex review this PR again |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
Motivation
performance_suttermination converted an SUT exit into large numbers of misleading downstream operation failures, so the runner must detect and report dead SUTs immediately.Description
SUT_HEALTH_CHECK_INTERVAL_SECONDSand aSutProcess.check_running()helper that surfaces exit code, POSIX signal (when applicable), transport/store/concurrency coordinate, active scenario, and a tail of the SUT log.run_command_json()with an optionalhealth_checkcallback and a loop that periodically invokes the health check while waiting for driver completion, so a dead SUT is detected and the driver is terminated immediately.run_wire_scenarios()to run each wire scenario as a separate invocation against the shared SUT and callsut.check_running(scenario)as thehealth_check, ensuring the active scenario is known when failures occur.tests/scripts/performance_runner_test.pythat validate scenario isolation, signal diagnostics/log-tail reporting, and thatrun_command_json()stops the driver when the SUT health check fails.