You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this issue after a Spring Boot update from Spring Boot 2.4.x to 2.6.3. This bug appears with lettuce-core 6.1.6.RELEASE. After downgrading it manually to 6.1.5.RELEASE, the error did not show up anymore.
Based on the git history, this bug might be a result of #1923
Unfortunately I could not figure out the root cause of this error. It appeared only on one environment and I could not reproduce it anywhere else. All I can provide is the stack trace and what I could figure out by reading the code.
Anyway, I hope this information helps:
Current Behavior
We have a scheduled task that writes data to Redis. Whenever this tasks runs the NullPointerException is thrown.
It would be interesting to know where the null-value for info comes from. the only point that I could see is the method NodeTopologyView#optionallyGet that must have been called in Line NodeTopologyView.java:90 (see Stacktrace). This method might return null:
private static <T> T optionallyGet(TimedAsyncCommand<?, ?, T> command) {
if (command.isCompletedExceptionally()) {
return null;
}
return command.join();
}
Since this seems to happen if the TimedAsyncCommand was completed exceptionally, this NullPointerException seems to be a follow up error. Anyway if a null value is used it should be ensured that it does not lead to a NullPointerException.
Expected behavior/code
No NullPointerException is thrown.
Environment
Lettuce version(s): 6.1.6.RELEASE
Possible Solution
null values are handled in a way that they don't lead to a NullPointerException.
In the best case some information why TimedAsyncCommand is completed exceptionally in optionallyGet is provided (e.g. by provide some logging) so that it is possible to see what exception it was and react on it as user of lettuce-core.
The text was updated successfully, but these errors were encountered:
mp911de
changed the title
NullPointerException: NodeTopologyView passes null-Value to StringReader constructorNodeTopologyView passes null-Value to StringReader constructor
Mar 16, 2022
Bug Report
I ran into this issue after a Spring Boot update from Spring Boot 2.4.x to 2.6.3. This bug appears with lettuce-core 6.1.6.RELEASE. After downgrading it manually to 6.1.5.RELEASE, the error did not show up anymore.
Based on the git history, this bug might be a result of #1923
Unfortunately I could not figure out the root cause of this error. It appeared only on one environment and I could not reproduce it anywhere else. All I can provide is the stack trace and what I could figure out by reading the code.
Anyway, I hope this information helps:
Current Behavior
We have a scheduled task that writes data to Redis. Whenever this tasks runs the
NullPointerException
is thrown.Stack trace
StringReader.java
is a JDK class that will throw aNullPointerException
if a null value is passed as parameter, because it calls.length()
on it.This value is passed in NodeTopologyView#parseInfo
It would be interesting to know where the
null
-value forinfo
comes from. the only point that I could see is the method NodeTopologyView#optionallyGet that must have been called in Line NodeTopologyView.java:90 (see Stacktrace). This method might returnnull
:Since this seems to happen if the
TimedAsyncCommand
was completed exceptionally, thisNullPointerException
seems to be a follow up error. Anyway if anull
value is used it should be ensured that it does not lead to aNullPointerException
.Expected behavior/code
No
NullPointerException
is thrown.Environment
Possible Solution
null
values are handled in a way that they don't lead to aNullPointerException
.In the best case some information why
TimedAsyncCommand
is completed exceptionally inoptionallyGet
is provided (e.g. by provide some logging) so that it is possible to see what exception it was and react on it as user of lettuce-core.The text was updated successfully, but these errors were encountered: