New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data race in the delegating logger #1359
Comments
Do you have a sample stacktrace for this race? |
Adding a lock to |
I think it is because of the init function that injects a null logger after 30 seconds. controller-runtime/pkg/log/log.go Lines 60 to 70 in 9e78e65
We don't call I can't see a good solution for this. It feels like a tradeoff between extra memory usage vs. thread safety. |
Well, I added locking around the logger replacing that is done via Fullfill in #1339, that is why I am confused as to why this still happens |
In
DelegatingLogger
, I think theFulfil
method needs to be protected by a lock as well. After upgrading to 0.8.1, our test suite reliably fails when run with the Go race detector. After I added locking code to theFulfil
method, the race detector became happy again.I can raise a PR for the change but I am struggling to produce a simple test case that reliably triggers the issue.
The text was updated successfully, but these errors were encountered: