Skip to content

Don't hold the Target's ModuleListLock over running LoadScriptingReso… #10738

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

Open
wants to merge 1 commit into
base: swift/release/6.2
Choose a base branch
from

Conversation

jimingham
Copy link

…urceInTarget (llvm#138216)

That calls an unknown amount of Python code, and can do quite a bit of work - especially if people do things like launch scripted processes in this script affordance. Doing that while holding a major lock like the ModuleList lock is asking for trouble.

I tried to make a test that would actually stall without this, but I couldn't come up with anything that reliably failed. You always have to get pretty unlucky.

(cherry picked from commit 0ddcd20)

…urceInTarget (llvm#138216)

That calls an unknown amount of Python code, and can do quite a bit of
work - especially if people do things like launch scripted processes in
this script affordance. Doing that while holding a major lock like the
ModuleList lock is asking for trouble.

I tried to make a test that would actually stall without this, but I
couldn't come up with anything that reliably failed. You always have to
get pretty unlucky.

(cherry picked from commit 0ddcd20)
@jimingham jimingham requested a review from a team as a code owner May 23, 2025 17:23
@jimingham jimingham requested a review from JDevlieghere May 23, 2025 17:23
@jimingham
Copy link
Author

@swift-ci please test

@jimingham
Copy link
Author

I can't see how that failure is related to this patch. Let's see if it's just a flakiness in the test, otherwise I'm in for a surprise...

@jimingham
Copy link
Author

@swift-ci please test

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