美文网首页
redis Unexpected end of stream异

redis Unexpected end of stream异

作者: xcardata | 来源:发表于2018-06-08 15:08 被阅读0次
图1

jedis提供链接池 使用的是apache common pool的第三方jar包,

在有些监控系统中会报Unexpected end of stream.错误,如上图所示

GenericObjectPool.borrowObject方法是真正从pool中取连接对像的方法。

JedisPoolConfig的设置如下:

图2

设置了conf.setTestOnBorrow(true); 在取对象时设置可用性验证,

每次取出来之前都要进行ping操作,即调用 JedisFactory.activateObject方法,如图1所示。

activateObject会等待RedisInputStream.ensureFill方法的返回信息,如果服务redisserver返回值不是正确就会报Unexpected end of stream异常。

但这并不影响客户端的使用,borrowObject方法源代码中

图3

while(p == null) 会再次从blockqueue中取,如果在超时时间内未取得再报exception

相关文章

网友评论

      本文标题:redis Unexpected end of stream异

      本文链接:https://www.haomeiwen.com/subject/alowlftx.html