influxdata / go-syslog

Blazing fast syslog parser
MIT License
476 stars 69 forks source link

Data race on currentid #44

Open AlekSi opened 3 years ago

AlekSi commented 3 years ago

https://github.com/influxdata/go-syslog/blob/ac565dc76ba6bb17b47140fb74355d1de7f19307/rfc5424/builder.go#L64-L65

Those two variables are defined on the package level. That means that two independent rfc5424.SyslogMessage objects with structured data can't be built concurrently – race detector correctly reports unsynchronised writes.

leodido commented 2 years ago

You're right, thanks for spotting it!

The fix is not that difficult but I don't have any spare time to do it. Would love to review a PR, tho!