-
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
Key equality detection log message doesn't include key value #900
Comments
Oh, thanks for raising this. Including the class makes sense. This string looks like an empty Map, so maybe someone used that as a key and modified the map later on? Adding class type for context is a great idea. For the exception it might not be as helpful as we'd hope. Most of the checks use I don't think there are enough changes to warrant a release atm, but what do you think about running a patch jar? That's easy to do via jitpack, the snapshot repo, or your own repository. |
Oh, this logging of |
the |
It seems that formatting would be broken regardless due to SLF4J-529, so if you use slf4j it would not print out correctly. Instead formatting it explicit seems to be the best approach. |
Previously the message used slf4j's format which differs from System.Logger's. This would be broken anyway due to SLF4J-529 as it uses String.format. Instead the message is formatted explicitly and the tests assert the contents.
Appreciate the fast response on this! I don't think I can run a patch in our "sanctioned" environments, but I can certainly clone the repo and install locally – especially if I can come up with a reproducible fail case on my end (I have a couple good candidates already). I'll grab the latest from the main branch & see how that goes. |
Let me know if it's not easily reproducible and I'll cut a release. A minor version bump is far better than the aggravation and time wasted if it isn't apparent. You can use the sonatype snapshot repository or jitpack repository (fixed version by git hash) rather than building a jar locally. |
I think a release would be much simpler – our build/packaging system is complicated enough to make adding external repos rather difficult. |
@ben-manes I'm able to reliably reproduce the error though actually asserting against it is tricky. Here's a gist which should demonstrate the issue. Assuming the new commit will successfully log the class name being used as the key – I think it will – that will be enough for me to track down the specific Many, many thanks for your help on this. |
Great, I’ll release it in a few minutes. You can look at my unit test updates too, where I capture the log message’s output to assert the contents. |
Released 3.1.6. It will take a while to get through the CI action and show up on maven central (I think they have an SLA of 2 hours, but it has gotten better recently) |
The hero I needed! Thanks @ben-manes – will holler if I see anything else amiss. |
In v3.1.2 release notes, you write that you "Added detection for when a key's equality has changed and corrupted the underlying map"; that error message is logged from BoundedLocalCache.logIfAlive().
In an application I manage we use
LoadingCache
fairly frequently, and we are seeing these messages in the logs, but they are always missing the value ofnode.getKeyReference()
. Here's an example:There is clearly something wrong in our code that's triggering the error to occur in the first place, which is what I'm trying to troubleshoot, but lacking useful logging here I'm not sure where to look.
Would it be possible to:
The text was updated successfully, but these errors were encountered: