Skip to content

Commit 8c2de2a

Browse files
authored
Merge branch 'master' into dpa/jet
2 parents 0d26d01 + 801c564 commit 8c2de2a

4 files changed

Lines changed: 69 additions & 30 deletions

File tree

.github/workflows/ci.yml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,37 @@ permissions:
2020

2121
jobs:
2222
test:
23-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
2423
runs-on: ${{ matrix.os }}
2524
strategy:
2625
fail-fast: false
2726
matrix:
2827
version:
28+
- '1.10'
29+
- '1.11'
30+
- '1.12'
2931
- 'nightly'
30-
- '1'
31-
- '1.9'
3232
os:
3333
- ubuntu-latest
3434
- windows-latest
35-
arch:
36-
- x64
37-
- x86
38-
include:
39-
- os: macOS-latest
40-
arch: aarch64
41-
version: '1'
42-
- os: macOS-latest
43-
arch: aarch64
44-
version: 'nightly'
35+
- macos-15-intel # Intel
36+
- macos-latest # Apple Silicon
37+
julia-wordsize:
38+
# The value here only affects the version of Julia binary that we download.
39+
# It does not affect the architecture of the GitHub Runner (virtual machine) that
40+
# we run on.
41+
- '32' # 32-bit Julia. Only available on x86_64. Not available on aarch64.
42+
- '64' # 64-bit Julia.
4543
exclude:
46-
- os: windows-latest # Killing workers doesn't work on windows in 1.9
47-
version: '1.9'
44+
# Killing workers doesn't work on Windows in Julia 1.10:
45+
- os: windows-latest
46+
version: '1.10'
47+
# We don't have 32-bit builds of Julia for Intel macOS:
48+
- os: macos-15-intel # Intel
49+
julia-wordsize: '32'
50+
#
51+
# We don't have 32-bit builds of Julia for Apple Silicon macOS:
52+
- os: macos-latest # Apple Silicon
53+
julia-wordsize: '32'
4854

4955
steps:
5056
- uses: actions/checkout@v6
@@ -53,7 +59,13 @@ jobs:
5359
- uses: julia-actions/setup-julia@v2
5460
with:
5561
version: ${{ matrix.version }}
56-
arch: ${{ matrix.arch }}
62+
# If `julia-wordsize` is 32, then we set `arch` to `x86`, because we know that
63+
# 32-bit builds of Julia are only available for x86.
64+
#
65+
# If `julia-wordsize` is 64, then we set `arch` to `${{ runner.arch }}`, which
66+
# GitHub will automatically expand to the correct value (`x86_64` or `aarch64`)
67+
# based on the architecture of the underlying GitHub Runner (virtual machine).
68+
arch: ${{ github.ref == '32' && 'x86' || runner.arch }}
5769
- uses: actions/cache@v5
5870
env:
5971
cache-name: cache-artifacts
@@ -65,9 +77,26 @@ jobs:
6577
${{ runner.os }}-test-${{ matrix.os }}
6678
${{ runner.os }}-
6779
- uses: julia-actions/julia-buildpkg@v1
80+
- name: Decide what the value of JULIA_NUM_THREADS should be
81+
id: decide-numthreads-str
82+
run: |
83+
if Base.VERSION >= v"1.12-"
84+
# The x,y format for threadpools requires Julia 1.9 or above.
85+
# However, Julia didn't begin starting with 1 interactive thread by default until Julia 1.12
86+
# So we don't need to bother with this on Julia 1.11 and earlier
87+
value = "1,0"
88+
else
89+
value = "1"
90+
end
91+
open(ENV["GITHUB_OUTPUT"], "a") do io
92+
name = "numthreads"
93+
line = "$(name)=$(value)"
94+
println(io, line)
95+
end
96+
shell: julia --color=yes {0}
6897
- uses: julia-actions/julia-runtest@v1
6998
env:
70-
JULIA_NUM_THREADS: 4,4
99+
JULIA_NUM_THREADS: ${{ steps.decide-numthreads-str.outputs.numthreads }}
71100
- uses: julia-actions/julia-processcoverage@v1
72101
- uses: codecov/codecov-action@v5
73102
with:

docs/src/_changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ CurrentModule = DistributedNext
77
This documents notable changes in DistributedNext.jl. The format is based on
88
[Keep a Changelog](https://keepachangelog.com).
99

10+
## Unreleased
11+
12+
### Fixed
13+
- Backported various fixes from Distributed ([#25]).
14+
- Fixed a lingering task that could cause hangs when exiting Distributed ([#51]).
15+
1016
## [v1.1.0] - 2025-08-02
1117

1218
### Fixed

src/DistributedNext.jl

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ include("pmap.jl")
132132
include("managers.jl") # LocalManager and SSHManager
133133
include("precompile.jl")
134134

135+
_stdlib_watcher_timer::Union{Timer, Nothing} = nothing
136+
135137
function __init__()
138+
global _stdlib_watcher_timer
136139
init_parallel()
137140

138141
if ccall(:jl_generating_output, Cint, ()) == 0
@@ -141,20 +144,12 @@ function __init__()
141144
# cluster cookie has been set, which is most likely to have been done
142145
# through Distributed.init_multi() being called by Distributed.addprocs() or
143146
# something.
144-
watcher_task = Threads.@spawn while true
147+
_stdlib_watcher_timer = Timer(0; interval=1) do timer
145148
if _check_distributed_active()
146-
return
147-
end
148-
149-
try
150-
sleep(1)
151-
catch
152-
# sleep() may throw when the internal object it waits on is closed
153-
# as the process exits.
154-
return
149+
close(timer)
155150
end
156151
end
157-
errormonitor(watcher_task)
152+
atexit(() -> close(_stdlib_watcher_timer))
158153
end
159154
end
160155

test/runtests.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,19 @@ include(joinpath(Sys.BINDIR, "..", "share", "julia", "test", "testenv.jl"))
1010

1111
cmd = `$test_exename $test_exeflags`
1212

13-
# LibSSH.jl currently only works on unixes
14-
if Sys.isunix()
13+
# LibSSH.jl currently only works on unixes, and the latest release currently
14+
# doesn't pass CI on MacOS.
15+
if Sys.islinux()
1516
# Run the SSH tests with a single thread because LibSSH.jl is not thread-safe
1617
sshtestfile = joinpath(@__DIR__, "sshmanager.jl")
18+
if Base.VERSION >= v"1.12-"
19+
# The x,y format for threadpools requires Julia 1.9 or above.
20+
# However, Julia didn't begin starting with 1 interactive thread by default until Julia 1.12
21+
# So we don't need to bother with this on Julia 1.11 and earlier
22+
JULIA_NUM_THREADS = "1,0"
23+
else
24+
JULIA_NUM_THREADS = "1"
25+
end
1726
run(addenv(`$cmd $sshtestfile`, "JULIA_NUM_THREADS" => "1"))
1827
else
1928
@warn "Skipping the SSH tests because this platform is not supported"

0 commit comments

Comments
 (0)