This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Setting maxsize breaks asyncio.JoinableQueue/Queue
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Chris Seto, gvanrossum, vstinner, yselivanov
Priority: normal Keywords:

Created on 2015-11-17 00:37 by Chris Seto, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py Chris Seto, 2015-11-17 00:37 Example code snippet that crashes
Messages (3)
msg254773 - (view) Author: Chris Seto (Chris Seto) * Date: 2015-11-17 00:37
When maxsize is set on a JoinableQueue/Queue and the queue is full (maxsize <= len(queue)) _put is called rather than __put_internal.
__put_internal increments _unfinished_tasks but _put does not.
Whenever using maxsize in a Queue calling task_done will almost always cause a ValueError('task_done() called too many times').
msg254776 - (view) Author: Chris Seto (Chris Seto) * Date: 2015-11-17 00:44
Looks to be fixed in python 3.6
msg254777 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2015-11-17 01:02
Should also be fixed in the next 3.4/3.5 releases. We rewrote the guts of the Queue class to be much simpler. See https://github.com/python/asyncio (specifically, https://github.com/python/asyncio/commit/872597ba12953849cc6893042fd044073b87f870).
History
Date User Action Args
2022-04-11 14:58:23adminsetgithub: 69828
2016-04-16 20:27:55berker.peksagsetstatus: open -> closed
type: crash -> behavior
stage: resolved
2015-11-17 01:02:09gvanrossumsetmessages: + msg254777
2015-11-17 00:44:43Chris Setosetresolution: fixed
messages: + msg254776
2015-11-17 00:37:33Chris Setocreate