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

Julia hanging with extensions + Distributed on latest backports-release-1.9 #49437

Closed
marius311 opened this issue Apr 20, 2023 · 1 comment · Fixed by #49441
Closed

Julia hanging with extensions + Distributed on latest backports-release-1.9 #49437

marius311 opened this issue Apr 20, 2023 · 1 comment · Fixed by #49441

Comments

@marius311
Copy link
Contributor

Sorry if I'm jumping the gun but haven't seen it mentioned and no one on Slack seemed to know about this, but a consequence of #49257 (slated to be included in 1.9.0-rc3) appears to be that Julia hangs when loading extension modules in sessions with multiple processes. I have a tiny MWE repo which reproduces this:

gh repo clone marius311/julia19_distributed_extension_hang_mwe
cd julia19_distributed_extension_hang_mwe
julia +1.9.0-rc2 mwe.jl # ok
julia +1.9.0-rc1 mwe.jl # hangs
julia +dev mwe.jl # hangs, where dev == after this PR

The code is just two dummy modules, one with an extension for the other, and code:

using Distributed
addprocs(2)
using Foo, Bar

Not sure the solution since #49257 is important for fixing #49250 (which I had also run into hence why I was running backports-release-1.9 when I noticed this)

@KristofferC
Copy link
Member

KristofferC commented Apr 20, 2023

On master we get:

      From worker 2:    │    ConcurrencyViolationError("deadlock detected in loading BarFooExt -> BarFooExt")

So the question is, why is BarFooExt trying to load itself?

Edit: What I think happens is:

  • We load Foo and Bar on the master and the worker. This causes the following to happen:
  • On both the master and the worker, the extension is triggered to be loaded (since the triggers for it are loaded).
  • On the master, the require call for loading the extension causes the package load callback to fire and try to load the extension on the worker.
  • So we have two require calls happening on the worker for the same extension. One from loading the triggers, and one from the package callback on the master.

Solutions to this could be:

  • Don't have loading extensions cause the package callbacks to execute
  • Don't have the callback load something that is an extension

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 a pull request may close this issue.

2 participants