[issue23582] multiprocessing.Queue.get is not getting all the items in the queue

2015-03-04 Thread Roberto Martínez
Roberto Martínez added the comment: That's not my point. To my understanding, when you put a item in the queue the item *must* be available to get in the next call. So I think put should block until the item is really in the queue so when you call get it return *always* and not some times (de

[issue23582] multiprocessing.Queue.get is not getting all the items in the queue

2015-03-04 Thread R. David Murray
R. David Murray added the comment: You are calling q.empty when draining the queue. That has the same documented caution. Since you are using get in that loop, in that case you *want* to be calling qsize, just like you do when you drain it at the end. --

[issue23582] multiprocessing.Queue.get is not getting all the items in the queue

2015-03-04 Thread Roberto Martínez
Roberto Martínez added the comment: I think you misunderstood my explanation. My english is not very good, sorry. I think that my previously attached file (mpqueuegetwrong.py) shows it better than my words. In this file you can see that I am not calling qsize nor get_nowait, only put and get.

[issue23582] multiprocessing.Queue.get is not getting all the items in the queue

2015-03-04 Thread R. David Murray
R. David Murray added the comment: This is the documented behavior. "qsize: Return the approximate size of the queue. Note, qsize() > 0 doesn't guarantee that a subsequent get() will not block, nor will qsize() < maxsize guarantee that put() will not block." It looks like what you want here i

[issue23582] multiprocessing.Queue.get is not getting all the items in the queue

2015-03-04 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +davin, sbt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue23582] multiprocessing.Queue.get is not getting all the items in the queue

2015-03-04 Thread Alexei Romanov
Changes by Alexei Romanov : -- nosy: +alexei.romanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue23582] multiprocessing.Queue.get is not getting all the items in the queue

2015-03-04 Thread Roberto Martínez
New submission from Roberto Martínez: We face yesterday a bug in a project, and after a few hours of investigation we found a bad/not documented behavior in multiprocessing.Queue. If you put one or more items in a queue and if the items are large, there is a delay between the put is executed a