-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fire package_loading callback at every require #28860
Conversation
2066a0b
to
7874be2
Compare
That's... cryptic. |
Never mind, scrolling helps.
|
Oh interesting, I should have waited for the tests to finish locally before going pushing and going to dinner. |
7874be2
to
708cd12
Compare
# Make sure that call of imported binding (on master) | ||
# works everywhere. | ||
for w in procs() | ||
remotecall_wait(seed, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seed
isn't a thing. Did you mean Random.seed!
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes :/
708cd12
to
aa6de12
Compare
Bump |
Will likely be breaking for Revise, but I can work with that. More relevant is JuliaLang/Distributed.jl#56. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm don't feel confident in this part of the code base so I've requested that @vtjnash reviews.
@@ -0,0 +1,6 @@ | |||
authors = ["Valentin Churavy <[email protected]>"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should probably go :)
It doesn't seem right to call these callbacks every time the package is requested. Is this only an issue involving Distributed, or is there a more general problem as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Jeff. It does seem like this callback is very much in the wrong place though, since it only triggers on calls to exactly require(:Foo)
.
Before this change we only fired package callbacks when a top-level module was freshly loaded or in
julia/base/loading.jl
Lines 644 to 646 in d55b044
require
so thatDistributed
has a change to propagate the users intent.The other solution that would come to mind is that we do a
as part of the worker setup, so that workers a
remotecall
is guaranteed to succeed.fixes JuliaLang/Distributed.jl#56
cc: other users of this callback @MikeInnes for Requires.jl and @timholy for Revise.jl (maybe?)