Skip to content

fix(a2a): add configurable drain timeout to guard against indefinite block#2337

Merged
bug-ops merged 1 commit intomainfrom
2329-a2a-drain-timeout
Mar 28, 2026
Merged

fix(a2a): add configurable drain timeout to guard against indefinite block#2337
bug-ops merged 1 commit intomainfrom
2329-a2a-drain-timeout

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 28, 2026

Closes #2329

Summary

  • Add drain_timeout_ms: u64 (default 30_000) to A2aServerConfig with #[serde(default)]
  • Wrap the output_rx drain loop in AgentTaskProcessor::process() with tokio::time::timeout
  • On timeout: log tracing::warn! with timeout_ms field and break — degraded behavior preferred over deadlock
  • Two new unit tests: normal drain (Flush arrives in time) and timeout path (sender held alive, Flush never arrives)

Test plan

  • cargo nextest run --features full --lib --bins — 6938/6938 passed
  • cargo +nightly fmt --check — clean
  • cargo clippy --features full --workspace -- -D warnings — clean

@github-actions github-actions bot added bug Something isn't working size/M Medium PR (51-200 lines) documentation Improvements or additions to documentation rust Rust code changes and removed size/M Medium PR (51-200 lines) labels Mar 28, 2026
…block (#2329)

Add `drain_timeout_ms` (default 30s) to `A2aServerConfig`. Wrap the
output_rx drain loop in `tokio::time::timeout`; log a warning and break
on expiry instead of blocking indefinitely if the agent loop panics
mid-turn while holding the sender Arc.
@bug-ops bug-ops force-pushed the 2329-a2a-drain-timeout branch from 6f912a8 to bb5f0a8 Compare March 28, 2026 09:41
@github-actions github-actions bot added the size/M Medium PR (51-200 lines) label Mar 28, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 28, 2026 09:41
@bug-ops bug-ops merged commit 6bb74c6 into main Mar 28, 2026
25 checks passed
@bug-ops bug-ops deleted the 2329-a2a-drain-timeout branch March 28, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(a2a): add configurable drain timeout in AgentTaskProcessor to guard against agent loop crash mid-turn

1 participant