JuliaLang / JuliaLang/Distributed.jl
Distributed remote references + precompilation
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 55
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Currently remote refs (RemoteChannel, Future) are a bit of a silent killer if used in precompiled module. Though our precompilation docs spell out in great detail the various constructors/patterns that should be avoided, nothing is mentioned of remote refs.
Digging into the implementation, however, reveals that remote refs use a global counter for self-identifying. It seems there's also likely to be issues with the worker id of the remote ref, but I didn't personally run into that (in my use-case, I was always creating RemoteChannels on pid 1 as "config variables" that all other worker processes could reference).
The problem identifies itself by producing invalid results: e.g. the first Future on pid 1 created at runtime will probably match the exact RRID of a precompiled RemoteChannel and hence isready, wait, fetch return results of the precompiled RemoteChannel instead of the Future. Quite a lovely surprise!
Obviously we want to avoid this situation of things seeming completely broken, so if that involves throwing explicit errors when precompiling a module w/ global RemoteChannel or Future variables, that seems safest to me. I'm not aware of all the precompilation magic that is available though in the case that we could actually make this work.
Ultimately, I think something more than just docs here.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start with the precompilation documentation and the RemoteChannel, Future, and RRID implementation, then trace how global counters and worker IDs behave across precompilation and runtime. Done means the invalid aliasing is prevented or rejected explicitly, with the relevant precompilation guidance updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- build-system, distributed-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100