Skip to content

Comments

implement TTL-based eviction for A2A rate limiter#321

Merged
bug-ops merged 2 commits intomainfrom
feat/m14/rate-limiter-eviction
Feb 15, 2026
Merged

implement TTL-based eviction for A2A rate limiter#321
bug-ops merged 2 commits intomainfrom
feat/m14/rate-limiter-eviction

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 15, 2026

Summary

  • Add periodic background task (every 60s) that evicts stale entries from rate limiter HashMap
  • Add max entries cap (10,000) with full clear as defense-in-depth
  • Add unit tests for eviction and cap behavior

Test plan

  • cargo nextest run -p zeph-a2a — 71 tests pass
  • cargo clippy --workspace -- -D warnings — clean

Closes #306

Add periodic background task that removes stale entries from the rate
limiter HashMap every 60 seconds. Add max entries cap (10,000) that
clears the map as defense-in-depth against unbounded growth.
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 88.13559% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zeph-a2a/src/server/router.rs 88.13% 7 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   79.96%   80.02%   +0.06%     
==========================================
  Files          98       98              
  Lines       23964    23982      +18     
==========================================
+ Hits        19163    19192      +29     
+ Misses       4801     4790      -11     
Files with missing lines Coverage Δ
crates/zeph-a2a/src/server/router.rs 96.65% <88.13%> (-2.41%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bug-ops bug-ops enabled auto-merge (squash) February 15, 2026 12:37
@bug-ops bug-ops merged commit b1c57aa into main Feb 15, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/m14/rate-limiter-eviction branch February 15, 2026 12:40
@bug-ops bug-ops mentioned this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement rate limiter eviction in A2A server

2 participants