Skip to content

Commit 48fc61d

Browse files
authored
Merge branch 'master' into ib/worker_output_customization
2 parents 4bc12f0 + d439c24 commit 48fc61d

File tree

8 files changed

+63
-11
lines changed

8 files changed

+63
-11
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
1616
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
test:
2023
name: julia -t${{ matrix.threads}} - ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -40,6 +43,8 @@ jobs:
4043
arch: x86
4144
steps:
4245
- uses: actions/checkout@v6
46+
with:
47+
persist-credentials: false
4348
- uses: julia-actions/setup-julia@v2
4449
with:
4550
version: ${{ matrix.version }}
@@ -59,6 +64,8 @@ jobs:
5964
runs-on: ubuntu-latest
6065
steps:
6166
- uses: actions/checkout@v6
67+
with:
68+
persist-credentials: false
6269
- uses: julia-actions/setup-julia@latest
6370
with:
6471
# version: '1.6'
@@ -70,3 +77,18 @@ jobs:
7077
julia --project=docs --color=yes docs/make.jl pdf
7178
env:
7279
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
80+
81+
jet:
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v6
85+
with:
86+
persist-credentials: false
87+
- uses: julia-actions/setup-julia@latest
88+
with:
89+
version: '1'
90+
# version: 'nightly'
91+
- uses: julia-actions/cache@v2
92+
- run: julia --color=yes --project=ci/jet -e 'import Pkg; Pkg.instantiate()'
93+
- name: Run the JET tests
94+
run: julia --color=yes -t4 --project=ci/jet ci/jet/check.jl

ci/jet/Project.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[deps]
2+
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
3+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
4+
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
5+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6+
7+
[sources]
8+
Distributed = {path = "../.."}

ci/jet/check.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Distributed: Distributed
2+
3+
using JET: JET
4+
using Serialization: Serialization
5+
using Test: Test, @testset
6+
7+
# We don't want to fail PkgEval because of a JET failure
8+
# Therefore, we don't put the JET tests in the regular Distributed test suite
9+
# Instead, we put it in a separate CI job, which runs on the Distributed repo
10+
11+
@testset "JET" begin
12+
ignored_modules = (
13+
# We will ignore Base:
14+
Base,
15+
16+
# We'll ignore the Serialization stdlib:
17+
Serialization,
18+
)
19+
JET.test_package(Distributed; ignored_modules)
20+
end

src/cluster.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ function create_worker(manager::ClusterManager, wconfig::WorkerConfig)
664664
end
665665
end
666666

667-
w = Worker(w_stub.id, r_s, w_s, manager; config=wconfig)
667+
w = Worker(w_stub.id, r_s, w_s, manager; config=wconfig)::Worker
668668
# install a finalizer to perform cleanup if necessary
669669
finalizer(w) do w
670670
if myid() == 1

src/macros.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ completion. To wait for completion, prefix the call with [`@sync`](@ref), like :
333333
macro distributed(args...)
334334
na = length(args)
335335
if na==1
336+
reducer = identity
336337
loop = args[1]
337338
elseif na==2
338339
reducer = args[1]

src/managers.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ end
526526

527527
function manage(manager::LocalManager, id::Integer, config::WorkerConfig, op::Symbol)
528528
if op === :interrupt
529-
kill(config.process, 2)
529+
kill(config.process::Process, 2)
530530
end
531531
end
532532

@@ -749,21 +749,22 @@ function kill(manager::LocalManager, pid::Int, config::WorkerConfig; profile_wai
749749
sleep(exit_timeout)
750750

751751
# Check to see if our child exited, and if not, send an actual kill signal
752-
if !process_exited(config.process)
752+
process = config.process::Process
753+
if !process_exited(process)
753754
@warn "Failed to gracefully kill worker $(pid)"
754755
profile_sig = Sys.iswindows() ? nothing : Sys.isbsd() ? ("SIGINFO", 29) : ("SIGUSR1" , 10)
755756
if profile_sig !== nothing
756757
@warn("Sending profile $(profile_sig[1]) to worker $(pid)")
757-
kill(config.process, profile_sig[2])
758+
kill(process, profile_sig[2])
758759
sleep(profile_wait)
759760
end
760761
@warn("Sending SIGQUIT to worker $(pid)")
761-
kill(config.process, Base.SIGQUIT)
762+
kill(process, Base.SIGQUIT)
762763

763764
sleep(term_timeout)
764-
if !process_exited(config.process)
765+
if !process_exited(process)
765766
@warn("Worker $(pid) ignored SIGQUIT, sending SIGKILL")
766-
kill(config.process, Base.SIGKILL)
767+
kill(process, Base.SIGKILL)
767768
end
768769
end
769770
end

src/process_messages.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function run_work_thunk(thunk::Function, print_error::Bool)
7575
end
7676
return result
7777
end
78-
function run_work_thunk(rv::RemoteValue, thunk)
78+
function run_work_thunk_remotevalue(rv::RemoteValue, thunk)
7979
put!(rv, run_work_thunk(thunk, false))
8080
nothing
8181
end
@@ -85,7 +85,7 @@ function schedule_call(rid, thunk)
8585
rv = RemoteValue(def_rv_channel())
8686
(PGRP::ProcessGroup).refs[rid] = rv
8787
push!(rv.clientset, rid.whence)
88-
errormonitor(@async run_work_thunk(rv, thunk))
88+
errormonitor(@async run_work_thunk_remotevalue(rv, thunk))
8989
return rv
9090
end
9191
end

src/workerpool.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ julia> default_worker_pool()
288288
WorkerPool(Channel{Int64}(sz_max:9223372036854775807,sz_curr:3), Set([4, 2, 3]), RemoteChannel{Channel{Any}}(1, 1, 4))
289289
```
290290
"""
291-
function default_worker_pool()
291+
function default_worker_pool()::AbstractWorkerPool
292292
# On workers retrieve the default worker pool from the master when accessed
293293
# for the first time
294294
if _default_worker_pool[] === nothing
@@ -298,7 +298,7 @@ function default_worker_pool()
298298
_default_worker_pool[] = remotecall_fetch(()->default_worker_pool(), 1)
299299
end
300300
end
301-
return _default_worker_pool[]
301+
return _default_worker_pool[]::AbstractWorkerPool
302302
end
303303

304304
"""

0 commit comments

Comments
 (0)