Skip to content

Commit 09533a9

Browse files
authored
Merge pull request #14 from JuliaParallel/close-watcher
Catch exception thrown from sleep() in the Distributed watcher
2 parents b03db8e + 91077f5 commit 09533a9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

docs/src/_changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ This documents notable changes in DistributedNext.jl. The format is based on
1212
### Fixed
1313
- Fixed a cause of potential hangs when exiting the process ([#16]).
1414

15-
## [v1.0.0] - 2024-12-02
16-
1715
### Added
1816
- A watcher mechanism has been added to detect when both the Distributed stdlib
1917
and DistributedNext may be active and adding workers. This should help prevent
2018
incompatibilities from both libraries being used simultaneously ([#10]).
2119

20+
## [v1.0.0] - 2024-12-02
21+
2222
### Fixed
2323
- Fixed behaviour of `isempty(::RemoteChannel)`, which previously had the
2424
side-effect of taking an element from the channel ([#3]).

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)