• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

prisma-risk / tsoracle / 26303181913
95%

Build:
DEFAULT BRANCH: main
Ran 22 May 2026 05:49PM UTC
Jobs 1
Files 54
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 May 2026 05:46PM UTC coverage: 95.893% (-0.02%) from 95.911%
26303181913

push

github

web-flow
fix(client): honor LeaderHint.leader_epoch and TTL the cached leader (#126)

* fix(client): honor LeaderHint.leader_epoch and TTL the cached leader

Track epoch and last-used Instant alongside the cached leader endpoint
so a delayed NOT_LEADER from an old epoch cannot flap the cache
backward, and a cached leader that has fallen quiet past
RetryPolicy::leader_ttl (default 30s) is re-evaluated rather than
pinned indefinitely.

- Replace ChannelPool.leader: Option<String> with
  Option<CachedLeader { endpoint, epoch: Option<u64>, last_used }>.
- accept_hint(hint_epoch) is the gate: reject only when the cache is
  fresh, both epochs are known, and the hint's epoch is strictly less
  than the cached one (monotone-forward).
- record_success(endpoint, epoch) refreshes last_used on hits and
  installs a fresh entry on misses; set_leader_with carries the hint
  path (epoch may be None for old servers).
- RetryPolicy gains leader_ttl: Duration, default 30s (~3x the default
  overall_deadline) so a steady-state leader is retained indefinitely
  but a quiet one re-evaluates the configured list.
- Stale hints are dropped silently and counted as
  tsoracle.client.leader_hint.stale.total.

Hints that omit leader_epoch (current server behaviour) and hints
arriving before the cache has seen any successful RPC are accepted
unconditionally so deployments mid-upgrade are not left without leader
discovery. Server-side population of leader_epoch is tracked in #125.

Refs #87

* test(client): cover classify_not_leader_hint and trim assert noise

Extract the post-FAILED_PRECONDITION decision (decode hint, reject
plaintext under TLS, gate on cached epoch) out of `attempt` into a
pure `classify_not_leader_hint(pool, endpoint, status) -> AttemptOutcome`
helper. Same shape as the existing `accept_hint`,
`rejects_plaintext_hint`, and `should_backoff` predicates — the
production path goes through the helper too, so the integration and
unit tests exercise the same code.

Adds six d... (continued)

223 of 239 new or added lines in 4 files covered. (93.31%)

2 existing lines in 1 file now uncovered.

7355 of 7670 relevant lines covered (95.89%)

750826.53 hits per line

Uncovered Changes

Lines Coverage ∆ File
15
85.67
3.08% crates/tsoracle-client/src/retry.rs
1
96.64
1.08% crates/tsoracle-client/src/leader_resolved.rs

Coverage Regressions

Lines Coverage ∆ File
2
85.67
3.08% crates/tsoracle-client/src/retry.rs
Jobs
ID Job ID Ran Files Coverage
1 26303181913.1 22 May 2026 05:49PM UTC 54
95.89
GitHub Action Run
Source Files on build 26303181913
  • Tree
  • List 54
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26303181913
  • a3e7a98e on github
  • Prev Build on main (#26302662986)
  • Next Build on main (#26303375756)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc