On 3 March 2015 at 19:01, Gustavo Carneiro <[email protected]> wrote:
> > > On 2 March 2015 at 10:12, Victor Stinner <[email protected]> wrote: > >> Hi, >> >> To answer Luciano's question on as_completed(), I read the source code >> of the function. It's not clear to me what happens on timeout. >> >> >> Should we abort something on timeout? The documentation doesn't >> explain if tasks are cancelled or if an exception is set. In the code, >> it's clear that the task is not touched. It's probably just a >> documentation issue. >> > > I think it should cancel the wrapped task. I think this is what the > programmer will want most of the time, and in case he doesn't want it he > can use shield() to prevent it. > I wasn't very clear: I think it should cancel the still running uncompleted tasks AND raise an exception, both. That would be consistent with the way wait_for() behaves. > > Also it makes it consistent with wait_for: > > https://code.google.com/p/tulip/issues/detail?id=107 > http://bugs.python.org/issue23219 > > >> >> >> Coroutine objects are wrapped into tasks: on timeout, these temporary >> tasks may be destroyed before their completion. A warning is emited in >> this case. The warning is useless, since the caller doesn't have >> access to all these temporary tasks. As gather(), we should probably >> set the _log_destroy_pending attribute of these tasks to False. What >> do you think? > > >> Victor >> > > > > -- > Gustavo J. A. M. Carneiro > Gambit Research > "The universe is always one step beyond logic." -- Frank Herbert > -- Gustavo J. A. M. Carneiro Gambit Research "The universe is always one step beyond logic." -- Frank Herbert
