Dan Kenigsberg has submitted this change and it was merged.

Change subject: virt: sampling: replace flag with Semaphore
......................................................................


virt: sampling: replace flag with Semaphore

In order to detect stuck sampling calls, the SampleVM
operation used a simple boolean flag to track if
the code was running or not.

However, this may lead to races if an operation unblocks
just after the flag was set.
This race is expected to do little harm, but could and should
be improved anyway.

To avoid race, we convert the boolean flag to a Semaphore.
The Semaphore is used as glorified counter, so it should
always be called with blocking=False.

Change-Id: I7d1b3ea990c1398255b216aeb247a56bd82ba7bd
Signed-off-by: Francesco Romani <from...@redhat.com>
Reviewed-on: https://gerrit.ovirt.org/40353
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <dan...@redhat.com>
---
M vdsm/virt/sampling.py
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Verified



-- 
To view, visit https://gerrit.ovirt.org/40353
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d1b3ea990c1398255b216aeb247a56bd82ba7bd
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: automat...@ovirt.org
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to