influxdata / go-syslog

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

Remove use of global vars for current id and param name #51

Closed BenMatase closed 6 months ago

BenMatase commented 1 year ago

Fixes https://github.com/influxdata/go-syslog/issues/44

This avoids a race when trying to populate multiple SyslogMessages concurrently.

I've tested this out in a scenario with telegraf where we were seeing this issue frequently and now we don't.

BenMatase commented 1 year ago

@leodido can't add you to reviewers

BenMatase commented 12 months ago

@leodido it changed a lot in the .go file. Is this error output the reason?

[bmatase@bmatase-mbp go-syslog (fix-global-var-race)]$ make build
ragel -I common -Z -G2 -e -o rfc5424/builder.go rfc5424/builder.go.rl
rfc5424/builder.go.rl:108:37: warning: applying plus operator to a machine that accepts zero length word
sed: -I or -i may not be used with stdin
make: *** [rfc5424/builder.go] Error 1
BenMatase commented 12 months ago

I see the problem. Working on fixing it

BenMatase commented 12 months ago

@leodido had some trouble with the -i aka inplace flags on my mac but I think it is in good shape now

BenMatase commented 11 months ago

@leodido I believe I've addressed the changes you requested. Let me know if there is anything else you spot

leodido commented 6 months ago

I don't have anymore write/maintain access here. So, I can't help/maintain it. It's unfortunate but it is what it is... Feel free to redirect this PR to https://github.com/leodido/go-syslog. I plan to keep evolving this project there, on my GitHub. Thank you