Skip to content
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

JsonCodecWrapper defeats CODECS LRUCacheMap cache #5625

Closed
adrian-skybaker opened this issue Feb 13, 2024 · 3 comments
Closed

JsonCodecWrapper defeats CODECS LRUCacheMap cache #5625

adrian-skybaker opened this issue Feb 13, 2024 · 3 comments
Labels
Milestone

Comments

@adrian-skybaker
Copy link

When using a high number (eg hundreds of thousands/millions) of RedissonJsonBucket instances, I found that the use of the JsonCodecWrapper generates an enormous number of values being entered into org.redisson.command.RedisExecutor#CODECS .

This is because a copy of the codec is created for every bucket, which then appears to the executor as a new codec for every single bucket.

I'm unclear on what the wrapper is achieving, especially the org.redisson.codec.JsonCodecWrapper#JsonCodecWrapper(org.redisson.codec.JsonCodec<?>) variant that simply presents the underlying codec unchanged, but perhaps it could implement hashCode/equals.

@mrniko
Copy link
Member

mrniko commented Feb 13, 2024

Is contextClassLoader is different per call? You can simply set useThreadClassLoader = false.

@adrian-skybaker
Copy link
Author

No it's not - I'll use that to workaround the issue, however I believe the issue still remains if left at the default true configuration.

@mrniko mrniko added this to the 3.27.1 milestone Feb 28, 2024
@mrniko mrniko added the bug label Feb 28, 2024
@mrniko mrniko modified the milestones: 3.27.1, 3.27.2 Feb 28, 2024
@mrniko
Copy link
Member

mrniko commented Feb 28, 2024

Fixed. Thanks for report.

@mrniko mrniko closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants