Skip to content

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

Closed

Description

@slash2314
mannequin
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']

Activity

  1. slash2314 commented on Jun 19, 2008

    slash2314mannequin
    MannequinAuthor

    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.

  2. amauryfa commented on Jun 19, 2008

    @amauryfa
    Contributor

    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?

  3. benjaminp commented on Jun 19, 2008

    @benjaminp
    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).

  4. tazle commented on Mar 27, 2009

    tazlemannequin
    Mannequin

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

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions