python redis Protocol Error

公司产品用的老爷牌python2.4.4,redis版本2.4.5,简直了。

分配了个任务,需要用到redis当作消息队列,基本没接触过。

python的redis库连接redis后,get等方法能够正常获取数据,但是使用set或者其他方法存数据时,却抛出一个异常

 File "build/bdist.linux-i686/egg/redis/connection.py", line 210, in read_response
 File "build/bdist.linux-i686/egg/redis/connection.py", line 68, in read_response
redis.exceptions.InvalidResponse: Protocol Error

可能因为版本bug问题,公司服务器上查看的源码和pypi中的源码不一致,提供的异常信息非常有限,网上搜索的资料也无法提供有效帮助,很秃然。服务器是生产环境,不能乱动,将python库中的redis文件夹复制后对源码进行修改,将connection.py的68行对应异常函数的response通过raise输出,然后通过交互模式进行调试,raise的信息:

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors durying writes if RDB snapshotting fail (stop-writes-on-bgsave-error option). Please check Redis logs for details about the error.

此信息搜索的结果说有可能是内存爆了。

然后感觉查看服务器内存,确实是内存满了。

记录在此,方便以后查看,以后发现redis能取不能存,可以优先查看服务器内存是否被用尽。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值