python-memcached并发调用get/set时出现RunTimeError:Second simultaneous read on fileno 8 detected.

在使用python-memcached库时遇到RuntimeError:Second simultaneous read on fileno 8 detected. 问题,怀疑是多线程或进程并发访问socket导致。解决方案是在每次get、set、delete操作时创建新的memcache客户端。虽然不清楚具体原因,但此方法有效且多次测试未重现问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

出现异常如下 RuntimeError: Second simultaneous read on fileno 8 detected.  Unless you really know what you're doing, make sure that only one greenthread can read any particular socket.  Consider using a pools.Pool. If you do know what you're doing and want to disable this error, call eventlet.debug.hub_multiple_reader_prevention(False)

2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake   File "/usr/lib/python2.7/dist-packages/memcache.py", line 862, in get
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake     return self._get('get', key)
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake   File "/usr/lib/python2.7/dist-packages/memcache.py", line 846, in _get
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake     return _unsafe_get()
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake   File "/usr/lib/python2.7/dist-packages/memcache.py", line 830, in _unsafe_get
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake     rkey, flags, rlen, = self._expectvalue(server)
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake   File "/usr/lib/python2.7/dist-packages/memcache.py", line 955, in _expectvalue
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake     line = server.re
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值