bpo-35125: remove inner callback on outer cancellation in asyncio shield by MainRo · Pull Request #10340 · python/cpython

@MainRo

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 unregistrer the callback from the inner future when the outer
future is cancelled.

1st1

1st1 approved these changes Feb 14, 2019

@MainRo

asvetlov

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 7, 2019
…eld (pythonGH-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
(cherry picked from commit b35acc5)

Co-authored-by: Romain Picard <romain.picard@oakbits.com>

miss-islington added a commit that referenced this pull request

May 7, 2019
…eld (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
(cherry picked from commit b35acc5)

Co-authored-by: Romain Picard <romain.picard@oakbits.com>