go-syslog icon indicating copy to clipboard operation
go-syslog copied to clipboard

Remove use of global vars for current id and param name

Open BenMatase opened this issue 1 year ago • 5 comments

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 avatar Nov 29 '23 19:11 BenMatase

@leodido can't add you to reviewers

BenMatase avatar Nov 29 '23 19:11 BenMatase

@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 avatar Nov 29 '23 21:11 BenMatase

I see the problem. Working on fixing it

BenMatase avatar Nov 29 '23 21:11 BenMatase

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

BenMatase avatar Dec 04 '23 18:12 BenMatase

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

BenMatase avatar Dec 13 '23 15:12 BenMatase

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

leodido avatar May 19 '24 09:05 leodido