I have a python web app that uses the pylibmc module to connect to a memcached server. If I test my app with requests once per second or slower, everything works fine. If I send more than one request per second, however, my app crashes and I see the following in my logs:
Assertion "ptr->query_id == query_id +1" failed for function "memcached_get_by_key" likely for "Programmer error, the query_id was not incremented.", at libmemcached/get.cc:107
Assertion "ptr->query_id == query_id +1" failed for function "memcached_get_by_key" likely for "Programmer error, the query_id was not incremented.", at libmemcached/get.cc:89
Any idea what's going wrong or how to fix it?
My code looks like this:
self.mc = pylibmc.Client(
servers=[os.environ.get(MEMCACHE_SERVER_VAR)],
username=os.environ.get(MEMCACHE_USER_VAR),
password=os.environ.get(MEMCACHE_PASS_VAR),
binary=True
)
#...
if (self.mc != None):
self.mc.set(key, stored_data)
#...
page = self.mc.get(key)