[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

Both 3.7.1rc2 and 3.6.7rc2

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Yury Selivanov


Yury Selivanov  added the comment:

Closing it now, Ned, thanks!  I assume it will make it into 3.7.1rc2, right?

--
priority: release blocker -> normal
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-07 Thread Ned Deily


Ned Deily  added the comment:

Is there any reason this issue needs to remain open?  Or can we at least remove 
the "release blocker" priority?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset dd0670f12b159eff5336d6011f046e1ccac495e1 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726) (GH-9728)
https://github.com/python/cpython/commit/dd0670f12b159eff5336d6011f046e1ccac495e1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d9212200fe8ddb55d73b8231869cfbb32635ba92 by Serhiy Storchaka in 
branch '3.7':
[3.7] Fix a compiler warning added in bpo-34872. (GH-9722). (GH-9726)
https://github.com/python/cpython/commit/d9212200fe8ddb55d73b8231869cfbb32635ba92


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9113

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9111

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3 by Serhiy Storchaka in 
branch 'master':
Fix a compiler warning added in bpo-34872. (GH-9722)
https://github.com/python/cpython/commit/addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9107

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Seems this change introduced a compiler warning.

/home/serhiy/py/cpython3.7/Modules/_asynciomodule.c: In function 
‘task_step_impl’:
/home/serhiy/py/cpython3.7/Modules/_asynciomodule.c:2666:44: warning: passing 
argument 1 of ‘_PyObject_CallMethodId’ from incompatible pointer type 
[-Wincompatible-pointer-types]
 r = _PyObject_CallMethodId(fut, _cancel, NULL);
^~~
In file included from ./Include/Python.h:128:0,
 from /home/serhiy/py/cpython3.7/Modules/_asynciomodule.c:1:
./Include/abstract.h:315:24: note: expected ‘PyObject * {aka struct _object *}’ 
but argument is of type ‘FutureObj * {aka struct  *}’
 PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj,
^~

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread Yury Selivanov


Yury Selivanov  added the comment:

> What's your assessment of the risk of option 2?

Let's not rush it in without testing, for sure.

Having 3.7.1rc2 would be great, but really up to you.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread Ned Deily


Ned Deily  added the comment:

Prior to this, there were no plans to have a 3.7.1rc2.  We have three options:

1. do a 3.7.1rc2 with this and possibly a few other cherry-picked changes
2. just cherry-pick this fix into 3.7.1 final
3. wait for 3.7.2 (in one to three months)

What's your assessment of the risk of option 2?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread Yury Selivanov


Yury Selivanov  added the comment:

Ned, elevating this to "release blocker", see https://bugs.python.org/msg326928

Feel free to close this issue.

--
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread miss-islington


miss-islington  added the comment:


New changeset a67bd53d3f80ac9c518b5426aa35459bd373b2b3 by Miss Islington (bot) 
(Elvis Pranskevichus) in branch '3.7':
[3.7] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task 
(GH-9679) (GH-9691)
https://github.com/python/cpython/commit/a67bd53d3f80ac9c518b5426aa35459bd373b2b3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread miss-islington


miss-islington  added the comment:


New changeset 166773df0ce6c852130f524029fa2e62b37b89cb by Miss Islington (bot) 
(Elvis Pranskevichus) in branch '3.6':
[3.6] bpo-34872: Fix self-cancellation in C implementation of asyncio.Task 
(GH-9679) (GH-9690)
https://github.com/python/cpython/commit/166773df0ce6c852130f524029fa2e62b37b89cb


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
pull_requests: +9078

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
pull_requests: +9077

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-03 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 0c797a6aca1c293e530e18c5e9fa02c670a9a4ed by Yury Selivanov (Elvis 
Pranskevichus) in branch 'master':
bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679)
https://github.com/python/cpython/commit/0c797a6aca1c293e530e18c5e9fa02c670a9a4ed


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-02 Thread Yury Selivanov


Yury Selivanov  added the comment:

Ned, will we have 3.7.1rc2?  If so, would it be possible to include the fix for 
this one?

--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-02 Thread Elvis Pranskevichus


Change by Elvis Pranskevichus :


--
keywords: +patch
pull_requests: +9068
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-02 Thread Vladimir Matveev


Change by Vladimir Matveev :


--
nosy: +v2m

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-02 Thread Yury Selivanov


Yury Selivanov  added the comment:

Elvis, please take a look at this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34872] investigate task/future cancellation in asynciomodule.c

2018-10-02 Thread Yury Selivanov


New submission from Yury Selivanov :

Vladimir Matveev has discovered that C and Python implementation of 
asyncio.Task diverge:

* asynciomodule.c:
https://github.com/python/cpython/blob/9012a0fb4c4ec1afef9efb9fdb0964554ea17983/Modules/_asynciomodule.c#L2716

* tasks.py:
https://github.com/python/cpython/blob/9012a0fb4c4ec1afef9efb9fdb0964554ea17983/Lib/asyncio/tasks.py#L286

In tasks.py we call "fut_obj.cancel()", so either "Task.cancel()" or 
"Future.cancel()" can be called depending on what "fut_obj" is.

In asynciomodule.c we essentially always call "Future.cancel(fut_obj)".  This 
probably leads to unexpected behaviour if "fut_obj" is either a Task or a Task 
subclass with an overloaded "cancel()" method.

We need to first write a set of tests to understand the scope of this; then 
we'll need to patch asynciomodule.c and backport this to 3.7 & 3.6.

--
components: asyncio
messages: 326896
nosy: Elvis.Pranskevichus, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: investigate task/future cancellation in asynciomodule.c
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com