fatal error: concurrent map writes
in EnumCodec.lookupAndCacheString
#2089
Labels
fatal error: concurrent map writes
in EnumCodec.lookupAndCacheString
#2089
Describe the bug
We've been seeing
fatal error: concurrent map writes
errors when running queries using PGX that queries data from tables that have a column with anenum
type.Here's an example stack trace, which should be read bottom to top:
I think this is because there's nothing in that object preventing concurrent map writes. I've had a stab at a fix in #2088
To Reproduce
I haven't created a minimal reproduction unfortunately (sorry!).
Expected behavior
I would expect to be able to concurrently query tables which contain an uncached enum value
Actual behavior
We get a
fatal error: concurrent map writes
Version
$ go version
-> go version go1.22.5 darwin/arm64$ psql --no-psqlrc --tuples-only -c 'select version()'
-> PostgreSQL 14.9 on aarch64-unknown-linux-gnu, compiled by aarch64-unknown-linux-gnu-gcc (GCC) 9.5.0, 64-bit$ grep 'github.com/jackc/pgx/v[0-9]' go.mod
-> v5.5.5Additional context
n/a
The text was updated successfully, but these errors were encountered: