There is a race condition inside this function, which is caused by this write.
The issue can be reproduced by running go test -v -race in this branch.
The fix itself is pretty simple, although I'm not sure if it introduces any other issues (deadlocks?) since I'm not very familiar with the package internals.
There is a race condition inside this function, which is caused by this write.
The issue can be reproduced by running
go test -v -race
in this branch.The fix itself is pretty simple, although I'm not sure if it introduces any other issues (deadlocks?) since I'm not very familiar with the package internals.