Commit 7b23d5f7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

workaround for possible too many open memcached connections problem.

in _initialiseConnection(), try to disconnect existing connections if exist.

python-memcached's get() returns None in case of any error, but it also returns None if None is set, of course. so if 'reconnect' is unfortunately triggered by None value, we should have a living connection at that time.

to fix this issue perfectly, we should rewrite memcached client library that raises an Exception in case of exception.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39553 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a3c7feb5
......@@ -101,6 +101,10 @@ if memcache is not None:
self._initialiseConnection()
def _initialiseConnection(self):
try:
self.memcached_connection.disconnect_all()
except AttributeError:
pass
init_dict = {}
if self.server_max_key_length is not MARKER:
init_dict['server_max_key_length'] = self.server_max_key_length
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment