Skip to content

Conversation

@Hadatko
Copy link

@Hadatko Hadatko commented Apr 28, 2022

Signed-off-by: Cervenka Dusan cervenka@acrios.com

Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
@Hadatko Hadatko requested a review from rhettinger as a code owner April 28, 2022 11:49
@ghost
Copy link

ghost commented Apr 28, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Every change to Python requires a NEWS entry.

Please, add it using the blurb_it Web app or the blurb command-line tool.

Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
@Hadatko Hadatko changed the title gh-60187 Added timeout to join function. gh-60187 Added timeout to queue join function. Apr 28, 2022
Signed-off-by: Cervenka Dusan <cervenka@acrios.com>
Copy link
Member

@orsenthil orsenthil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeout is disruptive in the queue operation. This needs to be discussed before any review and acceptance.

Issue ticket - #60187

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Hadatko
Copy link
Author

Hadatko commented Apr 28, 2022

No problem with that. Put and get have timeout too. It looks like it is missing requested feature since ~2012. As mentioned no problem to move it into its own function, but this looked more correct to me personally.

@rhettinger rhettinger self-assigned this Apr 30, 2022
@rhettinger
Copy link
Contributor

I appreciate the PR but don't think this should be added. The need is somewhat rare and we've done fine without it since 2010, nor has it been an issue with the matching API in multiprocessing.

The put() and get() methods need timeouts because they are more find-grained than join() which is used much differently. See previous discussion at https://bugs.python.org/issue9634 Without likely and compelling use cases, we should leave this out.

During the design discussion for SimpleQueue, Guido voiced an objection to having more sophisticated "task management" as part of the Queue API. Users have many options for communicating task completion including Condition variables, share counters, reply queues, etc.

@rhettinger rhettinger closed this Apr 30, 2022
@Hadatko
Copy link
Author

Hadatko commented May 9, 2022

It looks like you don't like consistent API. For example thread.join has timeout. I would expect same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants