-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
NullPointerException when RedisLockRegistry is destroyed #3888
Comments
arn-rio
added
status: waiting-for-triage
The issue need to be evaluated and its future decided
type: bug
labels
Sep 20, 2022
artembilan
added
in: redis
backport 5.5.x
and removed
status: waiting-for-triage
The issue need to be evaluated and its future decided
labels
Sep 20, 2022
Confirmed. Thank you! |
artembilan
added a commit
to artembilan/spring-integration
that referenced
this issue
Sep 20, 2022
Fixed spring-projects#3888 When `RedisLockType.SPIN_LOCK` (default), the `RedisLockRegistry.destroy()` causes an NPE on the `redisMessageListenerContainer` since pub-sub is not used in a busy-spin mode * Check for `redisMessageListenerContainer` before calling its `destroy()` **Cherry-pick to 5.5.x**
artembilan
added a commit
to artembilan/spring-integration
that referenced
this issue
Sep 20, 2022
Fixed spring-projects#3888 When `RedisLockType.SPIN_LOCK` (default), the `RedisLockRegistry.destroy()` causes an NPE on the `redisMessageListenerContainer` since pub-sub is not used in a busy-spin mode * Check for `redisMessageListenerContainer` before calling its `destroy()` **Cherry-pick to 5.5.x**
garyrussell
pushed a commit
that referenced
this issue
Sep 20, 2022
* GH-3888: Fix NPE in the `RedisLockRegistry.destroy()` Fixed #3888 When `RedisLockType.SPIN_LOCK` (default), the `RedisLockRegistry.destroy()` causes an NPE on the `redisMessageListenerContainer` since pub-sub is not used in a busy-spin mode * Check for `redisMessageListenerContainer` before calling its `destroy()` **Cherry-pick to 5.5.x** * * Reset properties in the `RedisLockRegistry` after `destroy()`
garyrussell
pushed a commit
that referenced
this issue
Sep 20, 2022
* GH-3888: Fix NPE in the `RedisLockRegistry.destroy()` Fixed #3888 When `RedisLockType.SPIN_LOCK` (default), the `RedisLockRegistry.destroy()` causes an NPE on the `redisMessageListenerContainer` since pub-sub is not used in a busy-spin mode * Check for `redisMessageListenerContainer` before calling its `destroy()` **Cherry-pick to 5.5.x** * * Reset properties in the `RedisLockRegistry` after `destroy()`
Thanks for the fix and the release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In what version(s) of Spring Integration are you seeing this issue?
5.5.14
Describe the bug
During spring shutdown, a Null Pointer exception is thrown when the RedisLockRegistry is destroyed (because the redisMessageListenerContainer attribute is null).
To Reproduce
Run the following application. When shutting down, this warning message is logged :
2022-09-19 18:13:53.065 WARN 2260 --- [ionShutdownHook] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'redisLockRegistry': java.lang.IllegalStateException: java.lang.NullPointerException
Expected behavior
It seems possible that there is no instance of redisMessageListenerContainer. We may check that the listener exists before calling destroy on it.
Sample
demo.zip
The text was updated successfully, but these errors were encountered: