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