Skip to content

Commit 06ce19e

Browse files
committed
Catch exception thrown from sleep() in the Distributed watcher
Otherwise the exception would be printed when the process exits.
1 parent b03db8e commit 06ce19e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/DistributedNext.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,14 @@ function __init__()
142142
if _check_distributed_active()
143143
return
144144
end
145-
146-
sleep(1)
145+
146+
try
147+
sleep(1)
148+
catch
149+
# sleep() may throw when the internal object it waits on is closed
150+
# as the process exits.
151+
return
152+
end
147153
end
148154
errormonitor(watcher_task)
149155
end

0 commit comments

Comments
 (0)