🐛 fix: serialize concurrent re-auth with a lock #201
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/serialize-reauth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Concurrent re-auth is serialized (#182):
Freshness is judged from
session_expires_at; when the server omitsx-cwt-token, waiters fall back to serialized logins (documented).Evidence
_reauthenticate()concurrently — cookie-jar race, N duplicate logins. Test run red: 2 logins for 3 workers (timing-dependent, sometimes 3).After: TDD — red confirmed first, then the lock; the concurrent test passes 3× consecutively (non-flaky),
pytest -q→ 243 passed,mypy→ clean.Merge Danger
Door: two-way
Blast Radius: low — single-threaded re-auth paths behave identically (the lock is uncontended); the freshness-skip is a strict subset of the old always-login behavior.
Closes #182.
cc7585ef4b5730a86d8dWIP: 🐛 fix: serialize concurrent re-auth with a lockto 🐛 fix: serialize concurrent re-auth with a lock