graphqlws
graphqlws copied to clipboard
Rare bug caused by concurrent map read and write
From 'handler.go':
line 63
delete(connections, conn)
line 94
connections[conn] = true
All of this logic occurs within a 'http.Handler', and is therefore multi-threaded. There are currently no safeguards against concurrent map read and map write. Perhaps this map should be replaced with a 'sync.Map' from the standard library?
Actually, does this map need to exist at all? As far as I can see it's never being read from, and my code runs fine without it.
Found another one caused by the "RemoveSubscriptions" function on a "subscriptionManager".