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-pthreading | Assignee: | Yaniv Bronhaim <ybronhei> |
| Status: | CLOSED WONTFIX | QA Contact: | Pavel Stehlik <pstehlik> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | python-pthreading-0.1.3 | CC: | 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: | |||
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 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. Yaniv, is anyone working on it - or are we going to? 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. I agree with Yaniv, we just need to document this difference, in case someone try to use pthreading in another context. |
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