Dan Kenigsberg has submitted this change and it was merged.

Change subject: tests: Fix rare deadlock in profile threads tests
......................................................................


tests: Fix rare deadlock in profile threads tests

There is a rare deadlock in yappi profiler, when starting a profile in
the same time a thread is started. This caused the
ThreadsProfileTests.test_running_threads to fail once in a while.

The deadlock happens when yappi find a new thread it does not know yet,
and try to get the thread class name. If the first call happen to be the
_active_limbo_lock.acquire, yappi calls back into python
threading.currentThread, which returns a _DummyThread, which try to lock
again _active_limbo_lock to register itself and deadlocks. See [1] for
complete details about this.

Since we start yappi profiles first thing on startup, this bug should
not effect vdsm in production.

Now the tests wait until the thread is fully started before running the
profiled function, avoiding the possible deadlock.  I verified this
change by running the failing tests 1000 times in a loop, without any
failure. Before this, we could not get 100 successful runs.

[1] https://code.google.com/p/yappi/issues/detail?id=48

Change-Id: I03594842ca341a7a2d54542396ef8ce82a67e167
Signed-off-by: Nir Soffer <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/31470
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M tests/profileTests.py
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Nir Soffer: Verified
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Looks good to me, but someone else must approve



-- 
To view, visit http://gerrit.ovirt.org/31470
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03594842ca341a7a2d54542396ef8ce82a67e167
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to