Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock EnumCodec.membersMap during reads and writes #2088

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 16, 2024

  1. Lock EnumCodec.membersMap during reads and writes

    We've been seeing a nondeterministic `fatal error: concurrent map
    writes` error while using PGX. I traced it to the `c.membersMap[s] = s`
    line, and I think that this is a true issue - there doesn't appear to be
    anything preventing concurrent access to this map.
    
    This PR adds a `sync.RWMutex` to `EnumCodec` and calls the appropriate
    `RLock` or `Lock` methods around read or write access.
    jamesroutley committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    3f2bdeb View commit details
    Browse the repository at this point in the history