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 gvanrossum
Recipients giampaolo.rodola, gvanrossum, pitrou, python-dev, ryder.lewis, vstinner, yselivanov
Date 2014-05-06.22:13:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399414407.22.0.211747679168.issue21447@psf.upfronthosting.co.za>
In-reply-to
Content
I'm a little closer to understanding the first (more common) traceback. I can repro it by running your demo program in a loop -- it may take a while but occasionally I do get the same InvalidStateError.

This appears to be an example of the problem speculated about in message #5 of https://code.google.com/p/tulip/issues/detail?id=58.

In order to find out which occurrence of call_later(future.set_result, None) is causing this, I replaced all of them (about half a dozen) with an equivalent lambda -- the lambda shows up in the traceback, unlike the location where call_soon() is called.

In this particular example, it is the last line of _SelectorSocketTransport.__init__() in selector_events.py (line 446).

I suspect there are other places where a similar problem can occur.  I still have to think more about how to fix this (without changing set_result() to always ignore a cancelled Future -- such a change would mask certain errors that I find important to catch).
History
Date User Action Args
2014-05-06 22:13:27gvanrossumsetrecipients: + gvanrossum, pitrou, vstinner, giampaolo.rodola, python-dev, yselivanov, ryder.lewis
2014-05-06 22:13:27gvanrossumsetmessageid: <1399414407.22.0.211747679168.issue21447@psf.upfronthosting.co.za>
2014-05-06 22:13:27gvanrossumlinkissue21447 messages
2014-05-06 22:13:26gvanrossumcreate