Skip to content

fix: report unexpected performance_sut exits and per-scenario wire health checks - #271

Merged
MisterVVP merged 4 commits into
mainfrom
dev-investigate-intermittent-grpc-performance-failure
Oct 7, 2026
Merged

MisterVVP merged 4 commits into
mainfrom
dev-investigate-intermittent-grpc-performance-failure

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Motivation

  • Silence around unexpected performance_sut termination converted an SUT exit into large numbers of misleading downstream operation failures, so the runner must detect and report dead SUTs immediately.
  • Running multiple wire scenarios back-to-back against a shared SUT hides which scenario was active when the SUT died, so per-scenario monitoring is needed for accurate diagnostics.

Description

  • Add SUT_HEALTH_CHECK_INTERVAL_SECONDS and a SutProcess.check_running() helper that surfaces exit code, POSIX signal (when applicable), transport/store/concurrency coordinate, active scenario, and a tail of the SUT log.
  • Extend run_command_json() with an optional health_check callback 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.
  • Change run_wire_scenarios() to run each wire scenario as a separate invocation against the shared SUT and call sut.check_running(scenario) as the health_check, ensuring the active scenario is known when failures occur.
  • Add/adjust unit tests in tests/scripts/performance_runner_test.py that validate scenario isolation, signal diagnostics/log-tail reporting, and that run_command_json() stops the driver when the SUT health check fails.

@MisterVVP MisterVVP added the codex Automatic label added by codex agent. Should not be used label Oct 6, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP added AI agent AI agent contribution and removed codex Automatic label added by codex agent. Should not be used labels Oct 6, 2026
@MisterVVP MisterVVP self-assigned this Oct 6, 2026
@MisterVVP MisterVVP changed the title Report unexpected performance_sut exits and per-scenario wire health checks fix: report unexpected performance_sut exits and per-scenario wire health checks Oct 6, 2026
@MisterVVP
MisterVVP marked this pull request as ready for review October 6, 2026 10:13
@MisterVVP
MisterVVP marked this pull request as draft October 6, 2026 20:25
### 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]>
@MisterVVP MisterVVP added the bug Something isn't working label Oct 7, 2026
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-07T09:44:08.644468Z def58e1 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread scripts/performance_runner.py Resolved
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread scripts/performance_runner.py Resolved
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this PR again

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: def58e18f2

ℹ️ 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 7, 2026 09:54
@MisterVVP
MisterVVP merged commit 216ab72 into main Oct 7, 2026
21 of 22 checks passed
@MisterVVP
MisterVVP deleted the dev-investigate-intermittent-grpc-performance-failure branch October 7, 2026 10:18
@MisterVVP MisterVVP mentioned this pull request Oct 8, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI agent AI agent contribution bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Investigate intermittent gRPC SUT failure during concurrent idle-stream cancellation

1 participant