Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3196

RedisQueueMessageDrivenAdapter - Loop after ConnectionFactory.destroy() without stop()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 3.0 RC1
    • Component/s: Redis Support
    • Labels:

      Description

      Some XD tests destroy the connection factory without stopping the adapter. This causes the adapter to go into a tight CPU loop...

      15:34:31,426 ERROR inbound.foo.0-int-redis:message-driven-channel-adapter8 channel.MessagePublishingErrorHandler:102 - failure occurred in messaging task
      org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis on localhost:6379; nested exception is com.lambdaworks.redis.RedisException: Unable to connect
      	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.createLettuceConnector(LettuceConnectionFactory.java:345)
      	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.initConnection(LettuceConnectionFactory.java:116)
      	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedConnection(LettuceConnectionFactory.java:325)
      	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getConnection(LettuceConnectionFactory.java:106)
      	at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:81)
      	at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:53)
      	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:173)
      	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:153)
      	at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:86)
      	at org.springframework.data.redis.core.DefaultListOperations.rightPop(DefaultListOperations.java:160)
      	at org.springframework.data.redis.core.DefaultBoundListOperations.rightPop(DefaultBoundListOperations.java:105)
      	at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.popMessageAndSend(RedisQueueMessageDrivenEndpoint.java:156)
      	at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.access$300(RedisQueueMessageDrivenEndpoint.java:47)
      	at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint$ListenerTask.run(RedisQueueMessageDrivenEndpoint.java:230)
      	at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
      	at java.lang.Thread.run(Thread.java:724)
      Caused by: com.lambdaworks.redis.RedisException: Unable to connect
      	at com.lambdaworks.redis.RedisClient.connect(RedisClient.java:176)
      	at com.lambdaworks.redis.RedisClient.connectAsync(RedisClient.java:139)
      	at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.createLettuceConnector(LettuceConnectionFactory.java:339)
      	... 15 more
      Caused by: java.util.concurrent.RejectedExecutionException: Worker has already been shutdown
      	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.registerTask(AbstractNioSelector.java:115)
      	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.register(AbstractNioSelector.java:100)
      	at org.jboss.netty.channel.socket.nio.NioClientBoss.register(NioClientBoss.java:42)
      	at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:121)
      	at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:70)
      	at org.jboss.netty.channel.Channels.connect(Channels.java:634)
      	at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:207)
      	at com.lambdaworks.redis.RedisClient.connect(RedisClient.java:165)
      	... 17 more
      

      I have fixed the XD tests, but we need to at least put some delay in the recovery code, as well as catching and logging the exception.

      We might also need an enhancement to the RedisConnectionFactory so we can interrogate it to see if it is closed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abilan Artem Bilan
              Reporter:
              grussell Gary Russell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: