-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ConcurrectModificationException while adjusting log-level in runtime #3283
Comments
I don't have a reliable production (it just randomly fails in our CI) but I looked at the code changes and based on my understanding of the problem I have confidence it fixes the issue, the change is similar to my own change that is included in the issue. I did include one other change which is not related to the bug at hand but is a "Best Practice" when it comes to using |
I removed the improper use of |
I saw your note, the change looks good to me! |
Closing as duplicate of #3234. |
Description
During startup of our service, which is multi-threaded, we occasionally get a ConcurrentModificationException when set try to adjust the log-level.
Configuration
Version: 2.24.2
Operating system: Windows 11, Linux
JDK: JDK17, JDK21. Tested with multiple distributions.
Logs
At this line of code:
We sometimes get this exception:
(Rest of stacktrace omitted since it's not relevant).
Reproduction
Unfortunately since this goes wrong due to race-conditions in a multi-threaded environment, it will be hard to make a unit-test.
I have created this patch against the current 2.x branch in the repository. The patch to InternalLoggerRegistry should fix this issue. The change to LoggerRegistry is not required but changes the code to use best practice of not adding to a collection from
Stream.forEach()
.The text was updated successfully, but these errors were encountered: