cloudflare / goflow

The high-scalability sFlow/NetFlow/IPFIX collector used internally at Cloudflare.
BSD 3-Clause "New" or "Revised" License
852 stars 171 forks source link

Data race in utils/netflow.go #82

Closed davmatjo closed 4 years ago

davmatjo commented 4 years ago

When running goflow with the workers flag set to greater than 1, the application will sometimes crash due to a concurrent map read and write.

Running goflow with go build -race also highlights many data races in the same places.

I believe the issue is in utils/netflow.go DecodeFlow() where templates and sampling can be written to when only a RLock has been acquired from the RWMutex.

lspgn commented 4 years ago

I'll have a look! Thank you for the report