Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang when calling get() on an empty queue in the queue module #47388

Closed
slash2314 mannequin opened this issue Jun 19, 2008 · 4 comments
Closed

Hang when calling get() on an empty queue in the queue module #47388

slash2314 mannequin opened this issue Jun 19, 2008 · 4 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@slash2314
Copy link
Mannequin

slash2314 mannequin commented Jun 19, 2008

BPO 3138
Nosy @amauryfa, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-06-19.12:49:02.621>
created_at = <Date 2008-06-19.08:08:16.445>
labels = ['type-bug', 'invalid']
title = 'Hang when calling get() on an empty queue in the queue module'
updated_at = <Date 2009-03-27.16:07:11.459>
user = 'https://bugs.python.org/slash2314'

bugs.python.org fields:

activity = <Date 2009-03-27.16:07:11.459>
actor = 'tazle'
assignee = 'none'
closed = True
closed_date = <Date 2008-06-19.12:49:02.621>
closer = 'benjamin.peterson'
components = []
creation = <Date 2008-06-19.08:08:16.445>
creator = 'slash2314'
dependencies = []
files = []
hgrepos = []
issue_num = 3138
keywords = []
message_count = 4.0
messages = ['68393', '68396', '68401', '84269']
nosy_count = 4.0
nosy_names = ['amaury.forgeotdarc', 'benjamin.peterson', 'slash2314', 'tazle']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3138'
versions = ['Python 3.0']

@slash2314
Copy link
Mannequin Author

slash2314 mannequin commented Jun 19, 2008

This behavior appears in Python 3.0b1. If you use queue.Queue and call
the get method on the empty queue, it appears to hang. The same
behavior seems to be evident in the PriorityQueue too.

@slash2314 slash2314 mannequin added the type-bug An unexpected behavior, bug, or error label Jun 19, 2008
@amauryfa
Copy link
Member

2.5 has the same behavior:

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Queue
>>> q = Queue.Queue()
>>> q.get()
.... block forever ...

Did you get different results?

@benjaminp
Copy link
Contributor

It's intended that Queue.get blocks until something is put on the Queue.
If you don't want it to block use Queue.get(False).

@tazle
Copy link
Mannequin

tazle mannequin commented Mar 27, 2009

Is it also intended that Queue.get() eats SIGINTs, requiring one to kill
the process with something heavier?

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants