Fix finalizer_ref usage of lock/wait resulting in task switches in gc context#41846
Merged
vtjnash merged 2 commits intoJuliaLang:masterfrom Aug 16, 2021
krynju:krynju/finalize_ref_task_switch_in_gc_context
Merged
Fix finalizer_ref usage of lock/wait resulting in task switches in gc context#41846vtjnash merged 2 commits intoJuliaLang:masterfrom krynju:krynju/finalize_ref_task_switch_in_gc_context
vtjnash merged 2 commits intoJuliaLang:masterfrom
krynju:krynju/finalize_ref_task_switch_in_gc_context
Conversation
vtjnash
reviewed
Aug 9, 2021
vtjnash
reviewed
Aug 9, 2021
vtjnash
reviewed
Aug 9, 2021
Contributor
Author
|
@vtjnash Thanks for the review! Forgot to cleanup that trylock logic, but I made it nice now. |
vtjnash
approved these changes
Aug 9, 2021
Contributor
Author
|
@Sacha0 Hey, could this be backported to 1.7? It's a relatively common error occuring in Dagger under any heavier usage. Would be awesome if this could be already fixed on 1.7 when it releases! |
Member
|
Tagging for backport --- thanks for the note Krystian! :) |
84 tasks
LilithHafner
pushed a commit
to LilithHafner/julia
that referenced
this pull request
Feb 22, 2022
LilithHafner
pushed a commit
to LilithHafner/julia
that referenced
this pull request
Mar 8, 2022
vchuravy
pushed a commit
to JuliaLang/Distributed.jl
that referenced
this pull request
Oct 6, 2023
…d task switches (JuliaLang/julia#41846) (cherry picked from commit d060255)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restructured some code, so that lock on the
client_refsis obtained once at the beginning of the finalizer.It's obtained using
trylockinstead oflockdown the line in the functions invoked later.Usage of
lockin gc context led to callingwait()and a task switch attempt.Catching the error and trying again led to different errors (switching to exited tasks) due to failed task switch handling in
ensure_scheduledintask.jl, so I went for repeatedtrylockinstead.Fix addresses the two following issues found in JuliaParallel/Dagger.jl#243
And supersedes #41786