concurrency issues
Another concurrecy crash:
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: fatal error: concurrent map iteration and map write
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: goroutine 551642 [running]:
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: reflect.mapiternext(0x4a22c9?)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/runtime/map.go:1392 +0x13
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: reflect.(*MapIter).Next(0xc000dfaff8?)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/reflect/value.go:2005 +0x74
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: encoding/json.mapEncoder.encode({0xc000dfb188?}, 0xc000b4ea80, {0x849b80?, 0xc00027c9a0?, 0xc000dfb180?}, {0xc?, 0x0?})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/encoding/json/encode.go:745 +0x334
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: encoding/json.structEncoder.encode({{{0xc001170480, 0x2, 0x2}, 0xc001236990, 0xc0012369c0}}, 0xc000b4ea80, {0x86e920?, 0xc00027c9a0?, 0xc000dfb2e8?}, {0x0, ...})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/encoding/json/encode.go:704 +0x21e
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: encoding/json.(*encodeState).reflectValue(0xc000b4ea80, {0x86e920?, 0xc00027c9a0?, 0x41b3c0?}, {0x0?, 0x38?})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/encoding/json/encode.go:321 +0x73
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: encoding/json.(*encodeState).marshal(0x835d80?, {0x86e920?, 0xc00027c9a0?}, {0x0?, 0x0?})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/encoding/json/encode.go:297 +0xc5
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: encoding/json.(*Encoder).Encode(0xc000dfb430, {0x86e920, 0xc00027c9a0})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/encoding/json/stream.go:209 +0xdf
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: gitlab.torproject.org/tpo/anti-censorship/rdsys/pkg/persistence/json.(*JsonPersistence).Save(0xc0001df5f0, {0x86e920, 0xc00027c9a0})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /home/user/dev/rdsys/pkg/persistence/json/json.go:52 +0x1eb
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: gitlab.torproject.org/tpo/anti-censorship/rdsys/pkg/core.partitionedHashring.save({0xc000522a80, 0xc0005222a0, 0xc000546108, {0x98eca0, 0xc0001df5f0}, 0x0})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /home/user/dev/rdsys/pkg/core/partitioned_hashring.go:177 +0x151
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: gitlab.torproject.org/tpo/anti-censorship/rdsys/pkg/core.Collection.Save(0xc00010c300?)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /home/user/dev/rdsys/pkg/core/collection.go:87 +0x9c
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: gitlab.torproject.org/tpo/anti-censorship/rdsys/internal.(*BackendContext).postResourcesHandler(0xc000078d70, {0x98faa8, 0xc00013c0e0}, 0xc000c06d80)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /home/user/dev/rdsys/internal/backend.go:453 +0x6c5
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: gitlab.torproject.org/tpo/anti-censorship/rdsys/internal.(*BackendContext).resourcesHandler(0xc000078d70, {0x98faa8, 0xc00013c0e0}, 0xc000c06d80)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /home/user/dev/rdsys/internal/backend.go:476 +0x192
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: gitlab.torproject.org/tpo/anti-censorship/rdsys/internal.(*BackendContext).startWebApi.metricsWrapper.func2({0x98faa8, 0xc00013c0e0}, 0xc000c06d80)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /home/user/dev/rdsys/internal/backend.go:41 +0xd2
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: net/http.HandlerFunc.ServeHTTP(0xc000258e60?, {0x98faa8?, 0xc00013c0e0?}, 0x10?)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/net/http/server.go:2166 +0x29
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: net/http.(*ServeMux).ServeHTTP(0x40ea65?, {0x98faa8, 0xc00013c0e0}, 0xc000c06d80)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/net/http/server.go:2683 +0x1ad
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: net/http.serverHandler.ServeHTTP({0x98e548?}, {0x98faa8?, 0xc00013c0e0?}, 0x6?)
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/net/http/server.go:3137 +0x8e
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: net/http.(*conn).serve(0xc000d04510, {0x990478, 0xc000429770})
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/net/http/server.go:2039 +0x5e8
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: created by net/http.(*Server).Serve in goroutine 754
Sep 23 04:09:50 polyanthum rdsys-backend[689345]: /usr/lib/go-1.22/src/net/http/server.go:3285 +0x4b
...