Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
version:
- 'nightly'
- '1.11' # This is the `release-julia-1.11` branch, so we run CI on Julia 1.11.x
os:
- ubuntu-latest
- macOS-latest
Expand All @@ -39,7 +39,7 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also switch to julia-actions/cache: #116
(but this is fine too)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I imagine the CI frequency on this branch will be pretty low-frequency, so probably not too pressing.

env:
cache-name: cache-artifacts
with:
Expand All @@ -64,7 +64,7 @@ jobs:
- uses: julia-actions/setup-julia@latest
with:
# version: '1.6'
version: 'nightly'
version: '1.11' # This is the `release-julia-1.11` branch, so we run CI on Julia 1.11.x
- name: Generate docs
run: |
julia --color=yes -e 'write("Project.toml", replace(read("Project.toml", String), r"uuid = .*?\n" =>"uuid = \"47e2e46d-f89d-539d-b4ee-838fcccc9c8e\"\n"));'
Expand Down
24 changes: 23 additions & 1 deletion src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,28 @@ function terminate_all_workers()
end
end

function choose_bind_addr()
# We prefer IPv4 over IPv6.
#
# We also prefer non-link-local over link-local.
# (This is because on HPC clusters, link-local addresses are usually not
# usable for communication between compute nodes.
#
# Therefore, our order of preference is:
# 1. Non-link-local IPv4
# 2. Non-link-local IPv6
# 3. Link-local IPv4
# 4. Link-local IPv6
addrs = getipaddrs()
i = something(
findfirst(ip -> !islinklocaladdr(ip) && ip isa IPv4, addrs), # first non-link-local IPv4
findfirst(ip -> !islinklocaladdr(ip) && ip isa IPv6, addrs), # first non-link-local IPv6
findfirst(ip -> ip isa IPv4, addrs), # first IPv4
findfirst(ip -> ip isa IPv6, addrs), # first IPv6
)
return addrs[i]
end

# initialize the local proc network address / port
function init_bind_addr()
opts = JLOptions()
Expand All @@ -1276,7 +1298,7 @@ function init_bind_addr()
else
bind_port = 0
try
bind_addr = string(getipaddr())
bind_addr = string(choose_bind_addr())
catch
# All networking is unavailable, initialize bind_addr to the loopback address
# Will cause an exception to be raised only when used.
Expand Down
Loading