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.

Author vstinner
Recipients giampaolo.rodola, gvanrossum, pitrou, richard.kiss, vstinner, yselivanov
Date 2014-06-20.15:16:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403277382.11.0.26636507976.issue21163@psf.upfronthosting.co.za>
In-reply-to
Content
> The more I use asyncio, the more I am convinced that the correct fix is to keep a strong reference to a pending task (perhaps in a set in the eventloop) until it starts.

The problem is not the task, read again my message. The problem is that nobody holds a strong reference to the Queue, whereas the producer is supposed to fill this queue, and the task is waiting for it.

I cannot make a suggestion how to fix your example, it depends on what you want to do.

> Without realizing it, I implicitly made this assumption when I began working on my asyncio project (a bitcoin node) in Python 3.3. I think it may be a common assumption for users. Ask around. I can say that it made the transition to Python 3.4 very puzzling.

Sorry, I don't understand the relation between this issue and the Python version (3.3 vs 3.4). Do you mean that Python 3.4 behaves differently?

The garbage collection of Python 3.4 has been *improved*. Python 3.4 is able to break more reference cycles.

If your program doesn't run anymore on Python 3.4, it means maybe that you rely on reference cycle, which sounds very silly.

> In several cases, I've needed to create a task where the side effects are important but the result is not. Sometimes this task is created in another task which may complete before its child task begins, which means there is no natural place to store a reference to this task. (Goofy workaround: wait for child to finish.)

I'm not sure that this is the same issue. If you think so, could you please write a short example showing the problem?
History
Date User Action Args
2014-06-20 15:16:22vstinnersetrecipients: + vstinner, gvanrossum, pitrou, giampaolo.rodola, yselivanov, richard.kiss
2014-06-20 15:16:22vstinnersetmessageid: <1403277382.11.0.26636507976.issue21163@psf.upfronthosting.co.za>
2014-06-20 15:16:22vstinnerlinkissue21163 messages
2014-06-20 15:16:21vstinnercreate