[ 
https://issues.apache.org/jira/browse/NIFI-8152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bernhard Geisberger updated NIFI-8152:
--------------------------------------
    Description: 
Since our upgrade to NiFi 1.12.1 (we ran 1.8 before), DetectDuplicate throws 
some rare NullPointerExceptions. It is not reproducible directly with the same 
flowfiles again.

The stacktrace shows that it is caused by 
RedisDistributedMapCacheClientService, line 165, where the results of 
redisConnection.exec() are checked.

Looking at the source code of spring-data-redis, it is actually possible that 
the exec() call returns null in some error cases, as you can see here:
https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java#L482

Update:
I've found out that this is related to a newer version of jedis in the 
classpath than that was bundled in NiFi. In particular, it was this change: 
https://github.com/redis/jedis/pull/1368
This is included in all versions after 2.9.0. (including bugfix versions 2.9.1+)

Considering this, I think it should be safe to consider the case of a 
null-response equal to an empty list at the two usages in 
RedisDistributedMapCacheClientService to allow newer jedis versions. 

  was:
Since our upgrade to NiFi 1.12.1 (we ran 1.8 before), DetectDuplicate throws 
some rare NullPointerExceptions. It is not reproducible directly with the same 
flowfiles again.

The stacktrace shows that it is caused by 
RedisDistributedMapCacheClientService, line 165, where the results of 
redisConnection.exec() are checked.

Looking at the source code of spring-data-redis, it is actually possible that 
the exec() call returns null in some error cases, as you can see here:
https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java#L482

Update:
I've found out that this is related to a newer version of jedis in the 
classpath than that was bundled in NiFi. In particular, it was this change: 
https://github.com/redis/jedis/pull/1368
This is included in all versions after 2.9.0.

Considering this, I think it should be safe to consider the case of a 
null-response equal to an empty list at the two usages in 
RedisDistributedMapCacheClientService to allow newer jedis versions. 

        Summary: RedisDistributedMapCacheClientService not compatible with 
newer versions of Jedis  (was: RedisDistributedMapCacheClientService throws NPE 
under rare circumstances)

> RedisDistributedMapCacheClientService not compatible with newer versions of 
> Jedis
> ---------------------------------------------------------------------------------
>
>                 Key: NIFI-8152
>                 URL: https://issues.apache.org/jira/browse/NIFI-8152
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.12.1
>         Environment: Custom Docker Image with OpenJDK 11, based on Debian
> Host: Debian Buster
>            Reporter: Bernhard Geisberger
>            Priority: Minor
>
> Since our upgrade to NiFi 1.12.1 (we ran 1.8 before), DetectDuplicate throws 
> some rare NullPointerExceptions. It is not reproducible directly with the 
> same flowfiles again.
> The stacktrace shows that it is caused by 
> RedisDistributedMapCacheClientService, line 165, where the results of 
> redisConnection.exec() are checked.
> Looking at the source code of spring-data-redis, it is actually possible that 
> the exec() call returns null in some error cases, as you can see here:
> https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java#L482
> Update:
> I've found out that this is related to a newer version of jedis in the 
> classpath than that was bundled in NiFi. In particular, it was this change: 
> https://github.com/redis/jedis/pull/1368
> This is included in all versions after 2.9.0. (including bugfix versions 
> 2.9.1+)
> Considering this, I think it should be safe to consider the case of a 
> null-response equal to an empty list at the two usages in 
> RedisDistributedMapCacheClientService to allow newer jedis versions. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to