Skip to content

Catch exception thrown from sleep() in the Distributed watcher #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down
10 changes: 8 additions & 2 deletions src/DistributedNext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading