From 06ce19e93874e0e89ea12c3090aec10f5c5dc9f3 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Wed, 4 Dec 2024 14:08:09 +0100 Subject: [PATCH 1/2] Catch exception thrown from sleep() in the Distributed watcher Otherwise the exception would be printed when the process exits. --- src/DistributedNext.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/DistributedNext.jl b/src/DistributedNext.jl index ca46ccf..01e54e3 100644 --- a/src/DistributedNext.jl +++ b/src/DistributedNext.jl @@ -142,8 +142,14 @@ function __init__() if _check_distributed_active() return end - - sleep(1) + + try + sleep(1) + catch + # sleep() may throw when the internal object it waits on is closed + # as the process exits. + return + end end errormonitor(watcher_task) end From 91077f589df070693ce19c2072ab38daacab4a8f Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Wed, 4 Dec 2024 14:09:06 +0100 Subject: [PATCH 2/2] Fix changelog The watcher entry was accidentally added under the v1 changelog. --- docs/src/_changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/_changelog.md b/docs/src/_changelog.md index 56d586e..f48aba3 100644 --- a/docs/src/_changelog.md +++ b/docs/src/_changelog.md @@ -12,13 +12,13 @@ This documents notable changes in DistributedNext.jl. The format is based on ### Fixed - Fixed a cause of potential hangs when exiting the process ([#16]). -## [v1.0.0] - 2024-12-02 - ### Added - A watcher mechanism has been added to detect when both the Distributed stdlib and DistributedNext may be active and adding workers. This should help prevent incompatibilities from both libraries being used simultaneously ([#10]). +## [v1.0.0] - 2024-12-02 + ### Fixed - Fixed behaviour of `isempty(::RemoteChannel)`, which previously had the side-effect of taking an element from the channel ([#3]).