Repository navigation
Release bfabric 1.24.2 - #651
Merged
Merged
Conversation
Merge release back into main (bfabric 1.24.1, bfabric_scripts 1.19.1)
B-Fabric rotates refresh tokens and, once a rotated one is presented again after the 10 s grace period, revokes every refresh token of that user and client. Processes sharing one token cache file (gunicorn workers, an RQ worker that unpickled the client, several CLI processes) each refreshed with their own in-memory copy, so all but the first got invalid_grant and could trigger the revocation. - When the in-memory token is expired (or missing), _ensure_token now takes an flock on <cache>.lock, adopts the cached token if it expires later, and only refreshes if that one is expired too; the refreshed token is persisted before the lock is released. A valid token still takes the fast path with no file I/O. - __init__ keeps the newer (by expires_at) of an explicit token and the cached one, under the same lock, and persists only an explicit token that is newer. A fresh login/exchange token still wins; an unpickled stale token no longer overwrites a newer cache entry. - client_credentials uses the same lock: harmless, and workers then share one fetched token instead of each fetching their own. - flock is POSIX-only; on Windows (not a supported/CI'd platform) the lock is a no-op and behaviour is unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
The temp file was named .<name>.<pid>.tmp, so two threads of one process (e.g. gunicorn with 16 threads) saving the same cache shared it: one renamed it into place and the other's replace() failed with FileNotFoundError. Use tempfile.mkstemp in the cache directory (0o600) for a unique name per write, keep the atomic replace, and remove the temp file if the write or rename fails. Co-Authored-By: Claude <noreply@anthropic.com>
OAuth: serialise token refreshes across processes sharing a token cache
Bump bfabric and move the two OAuth token-cache fixes from #650 out of the already-released 1.24.1 section, where they had landed, into 1.24.2. No other package has unreleased changes, and every dependent's bfabric range already admits 1.24.2. Release mechanics only; no code changes.
Contributor
🚀 Release PreviewThe following packages will be released when this PR is merged:
This comment is automatically updated when the PR changes. |
Contributor
✅ Release Distribution TestingPackages to release: bfabric Test Results:
Status: All tests passed with built distributions. The packages are ready for release. Last updated: 2026-11-18T11:12:27.423Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.