question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

com.lambdaworks.redis.RedisException: java.io.IOException: Connection reset by peer when execute handler in thread Thread

See original GitHub issue

hi,i used 4.2.2.Final,When connecting two redisServer in a JVM, would sometimes throw an exception,like this

com.lambdaworks.redis.RedisException: java.io.IOException: Connection reset by peer when execute handler in thread Thread[taskExecutorPreReg-203,5,main], printStackTrace com.lambdaworks.redis.RedisException: java.io.IOException: Connection reset by peer
        at com.lambdaworks.redis.LettuceFutures.await(LettuceFutures.java:109)
        at com.lambdaworks.redis.LettuceFutures.awaitOrCancel(LettuceFutures.java:77)
        at com.lambdaworks.redis.cluster.StatefulRedisClusterConnectionImpl$ClusterFutureSyncInvocationHandler.handleInvocation(StatefulRedisClusterConnectionImpl.java:330)
        at com.lambdaworks.redis.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:54)
        at com.sun.proxy.$Proxy26.smembers(Unknown Source)

I see RedisException extends RuntimeException,And when the set and get no exception is thrown,How be to return a responsibility excuse me? My setting is

<bean` id="redisCluster1" class="com.lambdaworks.redis.support.RedisClusterClientFactoryBean">
        <property name="uri" value="redis://${redis.cluster.host1}:${redis.cluster.port1}"/>
  </bean>
<bean id="redisCluster2" class="com.lambdaworks.redis.support.RedisClusterClientFactoryBean">
        <property name="uri" value="redis://${redis.cluster.host2}:${redis.cluster.port2}"/>
 </bean>

Looking forward to your reply

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
lannuocommented, Feb 25, 2020

@mp911de Exception:org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: java.io.IOException: Connection reset by peer at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:74) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:257) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.convertLettuceAccessException(LettuceStringCommands.java:718) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.get(LettuceStringCommands.java:63) at org.springframework.data.redis.connection.DefaultedRedisConnection.get(DefaultedRedisConnection.java:210) at org.springframework.data.redis.core.DefaultValueOperations$1.inRedis(DefaultValueOperations.java:52) at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:59) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) at org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:48) at one.top.eos.chain.utils.redis.RedisUtil.get(RedisUtil.java:97) at one.top.eos.chain.job.BlockNodeAnalysisJob.saveNode(BlockNodeAnalysisJob.java:116) at one.top.eos.chain.job.BlockNodeAnalysisJob.filterNodes(BlockNodeAnalysisJob.java:149) at one.top.eos.chain.job.BlockNodeAnalysisJob.execute(BlockNodeAnalysisJob.java:66) at com.xxl.job.core.thread.JobThread.run(JobThread.java:124) Caused by: io.lettuce.core.RedisException: java.io.IOException: Connection reset by peer at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:125) at io.lettuce.core.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:62) at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) at com.sun.proxy.$Proxy198.get(Unknown Source) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.get(LettuceStringCommands.java:61) … 12 more Caused by: java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcherImpl.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) at sun.nio.ch.IOUtil.read(IOUtil.java:192) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288) at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1108) at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748)

0reactions
tisla005commented, Sep 14, 2020

I am getting this same issue, was there a solution for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

When is "java.io.IOException:Connection reset by peer" thrown?
java.io.IOException: Connection reset by peer. The other side has abruptly aborted the connection in midst of a transaction.
Read more >
lettuce-io/Lobby - Gitter
if i call incr, it is saying com.lambdaworks.redis. ... RedisException: java.io.IOException: Connection reset by peer at io.lettuce.core.LettuceFutures.
Read more >
Lettuce Reference Guide
Redis connections are designed to be long-lived and thread-safe, and if the connection is lost will reconnect until close() is called. Pending ...
Read more >
出现错误:Redis exception:Connection reset by peer
Ask questionscom.lambdaworks.redis.RedisException: java.io.IOException: Connection reset by peer when execute handler in thread Thread ...
Read more >
unnecessary "java.io.IOException: Connection reset by peer ...
Issue 233: unnecessary "java.io.IOException: Connection reset by peer" in server log ... at java.lang.Thread.run(Thread.java:619). Show 0 older comments.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found