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,10 +133,11 @@ class Serialized(object): ...@@ -133,10 +133,11 @@ 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():
if not quiet:
f = sys._getframe(1) f = sys._getframe(1)
try: try:
logging.info('tic (%s:%u) ...', logging.info('tic (%s:%u) ...',
...@@ -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