fix(credential_pool): unpack the tuple in next_available_at's gate
Cross-PR interaction fix: #77714 (salvage of #71775) changed _available_entries to return (available, pending_refresh) while #77631 (salvage of #67642) added next_available_at() which still truthiness- tests the bare return. A non-empty tuple is always truthy — even ([], []) — so the reset-aware gate silently returned None ('no wait info') for every exhausted pool, disabling the feature #77631 shipped. Unpack the tuple and test the available list. Also adapts the lock-probe test for the RLock introduced by #77714 (same-thread non-blocking acquire always succeeds on an RLock; probe from a helper thread instead).
This commit is contained in:
@@ -642,7 +642,8 @@ class CredentialPool:
|
||||
``_available_entries`` caller (see the comment on ``has_available``).
|
||||
"""
|
||||
with self._lock:
|
||||
if self._available_entries():
|
||||
available, _pending = self._available_entries()
|
||||
if available:
|
||||
return None
|
||||
candidates: List[float] = []
|
||||
for entry in self._entries:
|
||||
|
||||
Reference in New Issue
Block a user