Skip to content

Commit 97a1dd1

Browse files
committed
fixup! debug
1 parent 56e7744 commit 97a1dd1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/process_messages.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ function showerror(io::IO, re::RemoteException)
6666
showerror(io, re.captured)
6767
end
6868

69+
const thunk_counter = Threads.Atomic{Int}(0)
70+
6971
function run_work_thunk(thunk::Function, print_error::Bool)
72+
Threads.atomic_add!(thunk_counter, 1)
7073
local result
7174
try
7275
result = thunk()
@@ -75,6 +78,7 @@ function run_work_thunk(thunk::Function, print_error::Bool)
7578
result = RemoteException(ce)
7679
print_error && showerror(stderr, ce)
7780
end
81+
Threads.atomic_add!(thunk_counter, -1)
7882
return result
7983
end
8084
function run_work_thunk(rv::RemoteValue, thunk)
@@ -208,7 +212,7 @@ function message_handler_loop(r_stream::IO, w_stream::IO, incoming::Bool)
208212
end
209213
readbytes!(r_stream, boundary, length(MSG_BOUNDARY))
210214

211-
println("$(now()) got msg: ", typeof(msg))
215+
println("$(now()) (thunk counter: $(thunk_counter[])) got msg: ", typeof(msg))
212216
handle_msg(msg, header, r_stream, w_stream, version)
213217
end
214218
catch e

test/topology.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ using Random
125125
end
126126

127127
# Initially only master-worker connections ought to be setup
128-
expected_num_conns = 4
128+
expected_num_conns = 8
129129
let num_conns = sum(asyncmap(p->remotecall_fetch(count_connected_workers,p), workers()))
130130
@test num_conns == expected_num_conns
131131
end

0 commit comments

Comments
 (0)