Skip to content

SubscriptionTask execution may end up with ArrayIndexOutOfBoundsException #2311

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

Closed
atisvagyok opened this issue Apr 27, 2022 · 1 comment
Closed
Assignees
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@atisvagyok
Copy link

Invocation of org.springframework.data.redis.listener.RedisMessageListenerContainer.SubscriptionTask#unwrap may result in an ArrayIndexOutOfBoundsException in case the passed collection (e.g. the channelMapping ConcurrentHashMap) is modified between the byte[][] unwrapped = new byte[holders.size()][]; and the for (ByteArrayWrapper arrayHolder : holders) { ... } calls.

Just like what I got from my application:

SubscriptionTask aborted with exception:

java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2

at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.unwrap(RedisMessageListenerContainer.java:851)
at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.eventuallyPerformSubscription(RedisMessageListenerContainer.java:810)
at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.run(RedisMessageListenerContainer.java:766)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

This affects the current 2.6.x branch.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 27, 2022
atisvagyok added a commit to atisvagyok/spring-data-redis that referenced this issue Apr 27, 2022
atisvagyok added a commit to atisvagyok/spring-data-redis that referenced this issue Apr 27, 2022
@christophstrobl christophstrobl self-assigned this May 9, 2022
@christophstrobl christophstrobl removed the status: waiting-for-triage An issue we've not yet triaged label May 9, 2022
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 9, 2022
@christophstrobl
Copy link
Member

Sorry for long silence - in the meantime RedisMessageListenerContainer has seen some major changes via #964 that are available starting 2.7.x. Given the current support timeline we'd recommend (if possible) to upgrade to a more recent version of the 3.x line nevertheless.

@christophstrobl christophstrobl added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

3 participants