jedis icon indicating copy to clipboard operation
jedis copied to clipboard

Inconsistent Jedis connection state after server down

Open TioBorracho opened this issue 15 years ago • 3 comments

Hi!

I'm opening this issue just to let everybody know that I'm worjking on this.

When you have an open connection to a server and the connection is lost, you get a jedisConnectionException from a Broken Pipe on getBulkData (for example for a get operation) but the jedis object still thinks it is connected.

I'll try/catch getBulkData to ckeck for socket exceptions and disconnect the jedis in that case to mantain consistency

TioBorracho avatar Apr 05 '11 17:04 TioBorracho

this seems like an excellent idea. it will leave Jedis instance in a consistent state, which is very important.

On Tue, Apr 5, 2011 at 2:46 PM, TioBorracho < [email protected]>wrote:

Hi!

I'm opening this issue just to let everybody know that I'm worjking on this.

When you have an open connection to a server and the connection is lost, you get a jedisConnectionException from a Broken Pipe on getBulkData (for example for a get operation) but the jedis object still thinks it is connected.

I'll try/catch getBulkData to ckeck for socket exceptions and disconnect the jedis in that case to mantain consistency

Reply to this email directly or view it on GitHub: https://github.com/xetorthio/jedis/issues/117

xetorthio avatar Apr 05 '11 17:04 xetorthio

I'll have to expand it to other commands. BTW do you thing of a better place to do it? I was hoping to adapt isConnected but I do not want to add extra messages on the net on every command. What do you think?

2011/4/5 xetorthio < [email protected]>

this seems like an excellent idea. it will leave Jedis instance in a consistent state, which is very important.

On Tue, Apr 5, 2011 at 2:46 PM, TioBorracho < [email protected]>wrote:

Hi!

I'm opening this issue just to let everybody know that I'm worjking on this.

When you have an open connection to a server and the connection is lost, you get a jedisConnectionException from a Broken Pipe on getBulkData (for example for a get operation) but the jedis object still thinks it is connected.

I'll try/catch getBulkData to ckeck for socket exceptions and disconnect the jedis in that case to mantain consistency

Reply to this email directly or view it on GitHub: https://github.com/xetorthio/jedis/issues/117

Reply to this email directly or view it on GitHub: https://github.com/xetorthio/jedis/issues/117#comment_960309

TioBorracho avatar Apr 05 '11 18:04 TioBorracho

See issue #123

TioBorracho avatar Apr 13 '11 13:04 TioBorracho