Skip to content

ioloop: Release callback references after caught exceptions - #3916

Open
wozhenbang2004 wants to merge 2 commits into
tornadoweb:masterfrom
wozhenbang2004:fix-ioloop-reference-cycles-3346
Open

wozhenbang2004 wants to merge 2 commits into
tornadoweb:masterfrom
wozhenbang2004:fix-ioloop-reference-cycles-3346

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Fixes #3346.

When a @gen.coroutine catches an exception from a yielded Future, the traceback can retain IOLoop callback frames that still reference that Future. The coroutine's locals then survive until cyclic GC.

Clear the Future and callback locals when each callback finishes, without changing the exception traceback. The regression covers returning after the catch and yielding again.

The regression fails on the base revision and passes with this change. The unchanged Test workflow passed in the fork. Local full-suite runs were blocked by AF_UNIX socket permissions.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible leak when exception is raised in inner coroutine

1 participant