Skip to content

refactor: clarify reconnect-related naming - #124

Merged
quettabit merged 2 commits into
mainfrom
qb/reconn-naming
Sep 11, 2026
Merged

quettabit merged 2 commits into
mainfrom
qb/reconn-naming

Conversation

@quettabit

Copy link
Copy Markdown
Member

No description provided.

@quettabit
quettabit requested a review from a team as a code owner September 11, 2026 03:44
@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR clarifies reconnect-related naming and makes advised-reconnect acquisition atomically record against the limiter.

  • Renames reconnect thresholds, outcomes, events, and local variables to distinguish server-advised reconnects.
  • Combines the limiter check and recording operation so errors after accepted advice cannot bypass reconnect throttling.
  • Updates both append and read session callers consistently.

Confidence Score: 5/5

The PR appears safe to merge; the previous reconnect-limiter bypass is resolved and no new actionable failures were found.

The limiter now records an accepted reconnect advice in the same operation that authorizes it, preventing retryable errors from opening an uncounted replacement connection. The previous finding was manually resolved, and the current implementation fully addresses its described failure mode.

Important Files Changed

Filename Overview
src/s2_sdk/_retrier.py Renames reconnect thresholds and replaces the predicate with an atomic acquire-and-record operation.
src/s2_sdk/_s2s/_append_session.py Adopts advised-reconnect terminology and uses atomic limiter acquisition before draining and reconnecting.
src/s2_sdk/_s2s/_read_session.py Updates read-session reconnect handling to use the atomic limiter operation consistently.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Server advises reconnect] --> B{Limiter permits advice?}
    B -->|No| C[Continue current session]
    B -->|Yes| D[Atomically record reconnect]
    D --> E[Drain or deliver pending data]
    E --> F{Session complete?}
    F -->|Yes| G[Return]
    F -->|No| H[Reconnect]
Loading

Reviews (2): Last reviewed commit: "restore single op that checks and record..." | Re-trigger Greptile

Comment thread src/s2_sdk/_s2s/_append_session.py Outdated
@quettabit
quettabit merged commit 5942acc into main Sep 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant