Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly cleanup thread locals for non-CoroutineDispatcher-intercepte… #4303

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

qwwdfsad
Copy link
Member

…d continuations

There was a one codepath not covered by undispatched thread local cleanup procedure: when a custom ContinuationInterceptor is used and the scoped coroutine (i.e. withContext) is completed in-place without suspensions.

Fixed with the introduction of the corresponding machinery for ScopeCoroutine

Fixes #4296

…d continuations

There was a one codepath not covered by undispatched thread local cleanup procedure: when a custom ContinuationInterceptor is used and the scoped coroutine (i.e. withContext) is completed in-place without suspensions.

Fixed with the introduction of the corresponding machinery for ScopeCoroutine

Fixes #4296
/*
* This is an adapted verion of test from #4296.
*
* qwwdfsad: the test relies on System.gc() actually collecting the garbage.
Copy link
Member Author

@qwwdfsad qwwdfsad Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, mate! That's indeed the issue, I'll rewrite the tests to be GC-agnostic

@qwwdfsad qwwdfsad merged commit f8c0304 into develop Dec 19, 2024
1 check was pending
@qwwdfsad qwwdfsad deleted the undispatched-tl-leak branch December 19, 2024 11:20
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.

2 participants