alphazero / jredis

Java Client and Connectors for Redis
http://code.google.com/p/jredis/
Apache License 2.0
315 stars 136 forks source link

Infinitive loop on reconnect (disconnect errors) #42

Open ragnor opened 13 years ago

ragnor commented 13 years ago

Sometime it happens that jredis falls into infinitive loop of throwing errors on disconnect method:

JREDIS: while attempting reconnect: Factual error in method ConnectionBase.disconnect() [file: ConnectionBase.java line:384 - package: org.jredis.ri.alphazero.connection]

Only way to stop this and release CPU resources (it consumes a lot of CPU time) is to restart server. Also when there are some problems with connection sometimes connection isn't used any more but there are many HeartbeatJinn threads.

Quick solution can be to use if (isConnected()) { // body of the disconnect method } instead of Assert.isTrue (isConnected(), IllegalStateException.class);

alphazero commented 13 years ago

That's a bug. What version of JRedis?

ragnor commented 13 years ago

It's occurred on JRedis 1.0-rc2. The same code is in current master: 2.0.0 Compatible.

BTW. Any plans for new official jredis release compatible with redis 2.x?

alphazero commented 13 years ago

I'm buried with work at work :) I certainly do want to.