Commit f4a66782 authored by Julien Muchembled's avatar Julien Muchembled

Do not flood logs when a client node sends a big packet in threaded tests

When run with MySQL, testBasicStore (neo.tests.threaded.test.Test) was slow
and generated log exceeded 29MB.
parent c9658ff3
......@@ -133,16 +133,17 @@ class Serialized(object):
p.set_trace(sys._getframe(3))
@classmethod
def tic(cls, step=-1, check_timeout=()):
def tic(cls, step=-1, check_timeout=(), quiet=False):
# If you're in a pdb here, 'n' switches to another thread
# (the following lines are not supposed to be debugged into)
with cls._tic_lock, cls.pdb():
f = sys._getframe(1)
try:
logging.info('tic (%s:%u) ...',
f.f_code.co_filename, f.f_lineno)
finally:
del f
if not quiet:
f = sys._getframe(1)
try:
logging.info('tic (%s:%u) ...',
f.f_code.co_filename, f.f_lineno)
finally:
del f
if cls._busy:
with cls._busy_cond:
while cls._busy:
......@@ -513,8 +514,9 @@ class NEOCluster(object):
lock = self._lock
def _lock(blocking=True):
if blocking:
logging.info('<SimpleQueue>._lock.acquire()')
while not lock(False):
Serialized.tic(step=1)
Serialized.tic(step=1, quiet=True)
return True
return lock(False)
self._lock = _lock
......
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