Skip to content

Commit f4b27a4

Browse files
Make worker debug messages consistent
1 parent 96caf0a commit f4b27a4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/workers.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ end
7373
function terminate!(w::Worker, from::Symbol=:manual)
7474
already_terminated = @atomicswap :monotonic w.terminated = true
7575
if !already_terminated
76-
@debug "terminating worker $(w.pid) from $from"
76+
@debug "terminating $(w) from $(from)"
7777
end
7878
wte = WorkerTerminatedException(w)
7979
@lock w.lock begin
@@ -114,7 +114,7 @@ end
114114
# Called when timeout_profile_wait is non-zero.
115115
function trigger_profile(w::Worker, timeout_profile_wait, from::Symbol=:manual)
116116
if !Sys.iswindows()
117-
@debug "sending profile request to worker $(w.pid) from $from"
117+
@debug "sending profile request to $(w) from $(from)"
118118
if Sys.islinux()
119119
kill(w.process, 10) # SIGUSR1
120120
elseif Sys.isbsd()
@@ -233,7 +233,7 @@ function redirect_worker_output(io::IO, w::Worker, fn, proc, ev::Threads.Event)
233233
end
234234
end
235235
catch e
236-
# @error "Error redirecting worker output $(w.pid)" exception=(e, catch_backtrace())
236+
# @error "Error redirecting $(w) output" exception=(e, catch_backtrace())
237237
terminate!(w, :redirect_worker_output)
238238
e isa EOFError || e isa Base.IOError || rethrow()
239239
finally
@@ -252,13 +252,13 @@ function process_responses(w::Worker, ev::Threads.Event)
252252
while isopen(w.socket) && !w.terminated
253253
# get the next Response from the worker
254254
r = deserialize(w.socket)
255-
@assert r isa Response "Received invalid response from worker $(w.pid): $(r)"
256-
# println("Received response $(r) from worker $(w.pid)")
255+
@assert r isa Response "Received invalid response from $(w): $(r)"
256+
# println("Received response $(r) from $(w)")
257257
@lock lock begin
258-
@assert haskey(reqs, r.id) "Received response for unknown request $(r.id) from worker $(w.pid)"
258+
@assert haskey(reqs, r.id) "Received response for unknown request $(r.id) from $(w)"
259259
# look up the Future for this request
260260
fut = pop!(reqs, r.id)
261-
@assert !isready(fut.value) "Received duplicate response for request $(r.id) from worker $(w.pid)"
261+
@assert !isready(fut.value) "Received duplicate response for request $(r.id) from $(w)"
262262
if r.error !== nothing
263263
# this allows rethrowing the exception from the worker to the caller
264264
close(fut.value, r.error)
@@ -268,7 +268,7 @@ function process_responses(w::Worker, ev::Threads.Event)
268268
end
269269
end
270270
catch e
271-
# @error "Error processing responses from worker $(w.pid)" exception=(e, catch_backtrace())
271+
# @error "Error processing responses from $(w)" exception=(e, catch_backtrace())
272272
terminate!(w, :process_responses)
273273
e isa EOFError || e isa Base.IOError || rethrow()
274274
end

0 commit comments

Comments
 (0)