Uploaded image for project: 'Bahir (Retired)'
  1. Bahir (Retired)
  2. BAHIR-247

Provide connection validation/idle testing for Flink-Redis Connector

    XMLWordPrintableJSON

Details

    Description

      When idle connections are timed-out and closed by Redis server, the following exception will be thrown and the Flink job will eventually fail:

      redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream. at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:199) at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40) at redis.clients.jedis.Protocol.process(Protocol.java:151) at redis.clients.jedis.Protocol.read(Protocol.java:215)
      ......
      

      It is clear that RedisCommandsContainerBuilder made use of GenericObjectPoolConfig without setting any parameters relating to idle testing. There are 2 possible solutions:

      1. Replace GenericObjectPoolConfig directly with JedisPoolConfig, which enabled idle testing by default;
      2. Make `testWhileIdle` configurable by user in FlinkJedisPoolConfig.

       Also, `testOnBorrow` and `testOnReturn` can be provided for those who want to validate connections.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lmagics Q Kang
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: