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

Bernhard Geisberger updated NIFI-8152:
--------------------------------------
    Description: 
Update:
I've found out that RedisDistributedMapCacheClientService is not compatible 
with newer versions of jedis. In particular, this change is breaking: 
https://github.com/redis/jedis/pull/1368
This is included in all versions after 2.9.0. (including bugfix versions 2.9.1+)

To ensure compatibility with newer jedis versions in the (global) classpath 
(which is unfortunately the only way to go sometimes), a null response from 
redis should be treated the same as an empty list. Furthermore, 
spring-data-redis and jedis can be upgraded with this change to their latest 
versions.

Original issue text:
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


  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. (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. 

     Issue Type: Improvement  (was: Bug)

> 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: Improvement
>          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
>
> Update:
> I've found out that RedisDistributedMapCacheClientService is not compatible 
> with newer versions of jedis. In particular, this change is breaking: 
> https://github.com/redis/jedis/pull/1368
> This is included in all versions after 2.9.0. (including bugfix versions 
> 2.9.1+)
> To ensure compatibility with newer jedis versions in the (global) classpath 
> (which is unfortunately the only way to go sometimes), a null response from 
> redis should be treated the same as an empty list. Furthermore, 
> spring-data-redis and jedis can be upgraded with this change to their latest 
> versions.
> Original issue text:
> 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



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

Reply via email to