JuliaLang / JuliaLang/Distributed.jl

Underministic behavior of `addprocs()` of `SSHManager`

Open
#8 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
55
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Given an array of node addresses as input, this function returns an array of launched worker PIDs. However, the returned pids do not necesssarily match the order of input addresses.

For example, the outcome of (p1, p2) = addprocs([machine1, machine2]) may be p1 running on machine2 and p2 running on machine1, or vice versa.

The cause of such underministic behavior is that launch(manager::SSHManager, ...) launches workers in parallel. Upon launching each worker, the pid of that worker will be pushed to launched, where no synchronization / ordering is performed:

https://github.com/JuliaLang/Distributed.jl/blob/fd9d120e90a31a9c50aa7a360a108227aa55f212/src/managers.jl#L177-L185

While this is not a bug, this undeterministic behavior seems counter-intuitive and is error-prone.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/managers.jl around lines 177-185, where launch(manager::SSHManager, ...) launches workers and pushes their PIDs into launched. Trace how input addresses and launched workers are associated, then verify that addprocs returns PIDs in input-address order while preserving parallel launches.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.