Skip to content

Ensure redis mutex is always released even context cancelled#5721

Merged
carmenlau merged 1 commit into
authgear:mainfrom
tung2744:dev-3587
May 14, 2026
Merged

Ensure redis mutex is always released even context cancelled#5721
carmenlau merged 1 commit into
authgear:mainfrom
tung2744:dev-3587

Conversation

@tung2744
Copy link
Copy Markdown
Contributor

Use context.WithoutCancel in the deferred unlock so the lock is always released even when the request context is cancelled (e.g. client disconnect). Introduce Handle.WithMutex to centralise the lock/unlock pattern and avoid repeating the fix at every call site.

ref DEV-2587

Use context.WithoutCancel in the deferred unlock so the lock is always
released even when the request context is cancelled (e.g. client
disconnect). Introduce Handle.WithMutex to centralise the lock/unlock
pattern and avoid repeating the fix at every call site.
@tung2744 tung2744 requested a review from carmenlau May 14, 2026 07:13
@tung2744 tung2744 changed the title Fix Redis mutex unlock ignoring context cancellation Ensure redis mutex is always released even context cancelled May 14, 2026
@carmenlau carmenlau merged commit 62640ac into authgear:main May 14, 2026
11 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.

2 participants