1. 28 Aug, 2015 2 commits
    • Julien Muchembled's avatar
      Several improvements to verbose locks · 5dc1f06c
      Julien Muchembled authored
      All these changes were useful to debug deadlocks in threaded tests:
      - New verbose Semaphore.
      - Logs with numerical 'ident' were too annoying to read so revert to thread
        name (before commit 5b69d553), with an
        exception for threaded tests. There remains one case where the result is not
        unique: when several client apps are instantiated.
      - Make deadlock detection optional.
      - Make it possible to name locks.
      - Make output more compact.
      - Remove useless 'debug_lock' option.
      - Add timing information.
      - Make exception more verbose when an un-acquired lock is released.
      
      Here is how I used 'locking':
      
      --- a/neo/tests/threaded/__init__.py
      +++ b/neo/tests/threaded/__init__.py
      @@ -37,0 +38 @@
      +from neo.lib.locking import VerboseSemaphore
      @@ -71 +72,2 @@ def init(cls):
      -        cls._global_lock = threading.Semaphore(0)
      +        cls._global_lock = VerboseSemaphore(0, check_owner=False,
      +                                            name="Serialized._global_lock")
      @@ -265 +267,2 @@ def start(self):
      -        self.em._lock = l = threading.Semaphore(0)
      +        self.em._lock = l = VerboseSemaphore(0, check_owner=False,
      +                                             name=self.node_name)
      @@ -346 +349,2 @@ def __init__(self, master_nodes, name, **kw):
      -        self.em._lock = threading.Semaphore(0)
      +        self.em._lock = VerboseSemaphore(0, check_owner=False,
      +                                         name=repr(self))
      5dc1f06c
    • Julien Muchembled's avatar
      Fix occasional deadlocks in threaded tests · 0b93b1fb
      Julien Muchembled authored
      deadlocks mainly happened while stopping a cluster, hence the complete review
      of NEOCluster.stop()
      
      A major change is to make the client node handle its lock like other nodes
      (i.e. in the polling thread itself) to better know when to call
      Serialized.background() (there was a race condition with the test of
      'self.poll_thread.isAlive()' in ClientApplication.close).
      0b93b1fb
  2. 14 Aug, 2015 2 commits
  3. 12 Aug, 2015 16 commits
  4. 28 Jul, 2015 1 commit
  5. 13 Jul, 2015 2 commits
  6. 10 Jul, 2015 1 commit
  7. 09 Jul, 2015 1 commit
  8. 03 Jul, 2015 3 commits
  9. 01 Jul, 2015 1 commit
  10. 30 Jun, 2015 2 commits
  11. 29 Jun, 2015 2 commits
  12. 24 Jun, 2015 7 commits