Bug 1117950

Summary: [RFE] Condition object must provide the n argument for notifying more than one waiter
Product: [oVirt] ovirt-distribution Reporter: Nir Soffer <nsoffer>
Component: python-pthreadingAssignee: Yaniv Bronhaim <ybronhei>
Status: CLOSED WONTFIX QA Contact: Pavel Stehlik <pstehlik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: python-pthreading-0.1.3CC: bazulay, bugs, danken, nsoffer, oourfali, srevivo, ybronhei
Target Milestone: ---Keywords: FutureFeature
Target Release: ---Flags: oourfali: ovirt-future?
sherold: Triaged+
rule-engine: planning_ack?
oourfali: devel_ack?
rule-engine: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-27 10:36:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nir Soffer 2014-07-09 17:06:59 UTC
Description of problem:

pthreading.Condition.notify does not provide the n argument that was added in Python 2.7. This make prevent using this class as a drop in replacement fro the builtin threading.Condition class.

Version-Release number of selected component (if applicable):
python-pthreading-1.3

This is the required interface:

    def notify(n=1):

When calling with n>1, this should wake up n waiters, but the Python
documentation warn that " it’s not safe to rely on this behavior. A future, optimized implementation may occasionally wake up more than n threads."
So we may choose to implement it ny invoking notify_all().

See https://docs.python.org/2/library/threading.html#threading.Condition.notify

Comment 1 Saggi Mizrahi 2014-07-13 08:09:43 UTC
We could just do a for loop calling notify() though I don't understand why make this part of the interface. Could easily be done by the caller. Classic python stdlib over-design

Comment 3 Red Hat Bugzilla Rules Engine 2015-11-30 22:37:27 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 4 Yaniv Kaul 2017-11-19 12:53:18 UTC
Yaniv, is anyone working on it - or are we going to?

Comment 5 Yaniv Bronhaim 2017-11-19 12:58:18 UTC
with vdsm current use cases in pthreading I don't see any need to align the interface and publish new version of pthreading for ovirt
Nir, please tell your opinion and change status if needed.

Comment 6 Nir Soffer 2017-11-19 17:03:48 UTC
I agree with Yaniv, we just need to document this difference, in case someone try
to use pthreading in another context.