Skip to content

fix: potential race condition#304

Merged
cb80 merged 2 commits into
mainfrom
providers
Jun 4, 2026
Merged

fix: potential race condition#304
cb80 merged 2 commits into
mainfrom
providers

Conversation

@cb80
Copy link
Copy Markdown
Contributor

@cb80 cb80 commented Jun 1, 2026

Summary

Successfully fixed the concurrent map access race condition in the OIDC handler by adding proper synchronization with sync.RWMutex.

Changes Made

File: internal/handler/oidc.go

  1. Added sync import (line 9)

  2. Added mutex field to OIDC struct (line 32):

    providersMu sync.RWMutex // protects staticProviders
  3. Protected write operations in RegisterStaticProvider (lines 133-134):

    handler.providersMu.Lock()
    defer handler.providersMu.Unlock()
  4. Protected read operations in ProviderFor (lines 280, 287, 292, 295):

    • Added RLock() at the beginning of map access
    • Added RUnlock() before each return that reads from the map
    • Added final RUnlock() before falling through to session manager

@cb80 cb80 self-assigned this Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f3085ca2-cc2f-411c-8b3a-b0e88af3301a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cb80 cb80 marked this pull request as ready for review June 1, 2026 10:56
Signed-off-by: Chris Burkert <burkert.chris@gmail.com>
@cb80 cb80 merged commit 28b5289 into main Jun 4, 2026
10 checks passed
@cb80 cb80 deleted the providers branch June 4, 2026 09:11
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.

3 participants