]> granicus.if.org Git - python/commit
bpo-35125: remove inner callback on outer cancellation in asyncio shield (GH-10340)
authorRomain Picard <romain.picard@oakbits.com>
Tue, 7 May 2019 18:58:24 +0000 (20:58 +0200)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 May 2019 18:58:24 +0000 (11:58 -0700)
commitb35acc5b3a0148c5fd4462968b310fb436726d5a
tree844dd82ca54e012a0416a1abb959d9a7b396e4bc
parentf7bda5c5729a3cc69b32c2a3baf5c64dea666d33
bpo-35125: remove inner callback on outer cancellation in asyncio shield (GH-10340)

When the future returned by shield is cancelled, its completion callback of the
inner future is not removed. This makes the callback list of inner inner future
grow each time a shield is created and cancelled.

This change unregisters the callback from the inner future when the outer
future is cancelled.

https://bugs.python.org/issue35125
Lib/asyncio/tasks.py
Lib/test/test_asyncio/test_tasks.py
Misc/NEWS.d/next/Library/2019-02-15-17-18-50.bpo-35125.h0xk0f.rst [new file with mode: 0644]