Skip to content

fix: incorrect tracking of usable conns in reaper - #132

Merged
quettabit merged 1 commit into
mainfrom
qb/128
Sep 13, 2026
Merged

quettabit merged 1 commit into
mainfrom
qb/128

Conversation

@quettabit

Copy link
Copy Markdown
Member

closes #128

@quettabit
quettabit requested a review from a team as a code owner September 13, 2026 05:59
@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR corrects idle-connection reaping by basing the retention threshold on non-retired, available connections rather than every connection in the host pool.

  • Prevents unavailable or retired connections from causing the last usable idle connection to be reaped.
  • Updates the usable count as idle connections are selected for closure.

Confidence Score: 5/5

The PR appears safe to merge; the revised accounting consistently preserves one usable connection while pruning stale pool entries.

The reaper computes and updates its usable-connection count synchronously, and no changed behavior was found that introduces a concrete correctness, compatibility, or security failure.

Important Files Changed

Filename Overview
src/s2_sdk/_client.py Corrects reaper accounting so idle cleanup retains one available, non-retired connection per host.

Reviews (1): Last reviewed commit: "initial commit" | Re-trigger Greptile

@quettabit
quettabit merged commit e7f63b8 into main Sep 13, 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.

[Detail Bug] HTTP client pool reaper can drop the last usable connection when a retired streaming connection exists

1 participant