Skip to content
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

Replace a timeout task with timedwait() #117

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Replace a timeout task with timedwait() #117

merged 1 commit into from
Jan 6, 2025

Conversation

JamesWrigley
Copy link
Collaborator

According to a stacktrace from a hung DistributedNext CI job this task was causing the process to hang before exiting:

InterruptException()
_jl_mutex_unlock at C:/workdir/src\threading.c:1012
jl_mutex_unlock at C:/workdir/src\julia_locks.h:80 [inlined]
ijl_task_get_next at C:/workdir/src\scheduler.c:458
poptask at .\task.jl:1163
wait at .\task.jl:1172
task_done_hook at .\task.jl:839
jfptr_task_done_hook_98752.1 at C:\hostedtoolcache\windows\julia\nightly\x64\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:2233 [inlined]
jl_finish_task at C:/workdir/src\task.c:338
start_task at C:/workdir/src\task.c:1274
      From worker 82:	fatal: error thrown and no exception handler available.Unhandled Task ERROR: InterruptException:
Stacktrace:
 [1] poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
   @ Base .\task.jl:1163
 [2] wait()
   @ Base .\task.jl:1172
 [3] wait(c::Base.GenericCondition{ReentrantLock}; first::Bool)
   @ Base .\condition.jl:141
 [4] wait
   @ .\condition.jl:136 [inlined]
 [5] put_buffered(c::Channel{Any}, v::Int64)
   @ Base .\channels.jl:420
 [6] put!(c::Channel{Any}, v::Int64)
   @ Base .\channels.jl:398
 [7] put!(rv::DistributedNext.RemoteValue, args::Int64)
   @ DistributedNext D:\a\DistributedNext.jl\DistributedNext.jl\src\remotecall.jl:703
 [8] (::DistributedNext.var"#create_worker##11#create_worker##12"{DistributedNext.RemoteValue, Float64})()
   @ DistributedNext D:\a\DistributedNext.jl\DistributedNext.jl\src\cluster.jl:721

Replaced it with a call to timedwait(), which has the advantage of being a lot simpler than an extra task.

Cherry-picked from JuliaParallel/DistributedNext.jl#16.

According to a stacktrace from a hung DistributedNext CI job this task was
causing the process to hang before exiting:
```julia
InterruptException()
_jl_mutex_unlock at C:/workdir/src\threading.c:1012
jl_mutex_unlock at C:/workdir/src\julia_locks.h:80 [inlined]
ijl_task_get_next at C:/workdir/src\scheduler.c:458
poptask at .\task.jl:1163
wait at .\task.jl:1172
task_done_hook at .\task.jl:839
jfptr_task_done_hook_98752.1 at C:\hostedtoolcache\windows\julia\nightly\x64\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:2233 [inlined]
jl_finish_task at C:/workdir/src\task.c:338
start_task at C:/workdir/src\task.c:1274
      From worker 82:	fatal: error thrown and no exception handler available.Unhandled Task ERROR: InterruptException:
Stacktrace:
 [1] poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
   @ Base .\task.jl:1163
 [2] wait()
   @ Base .\task.jl:1172
 [3] wait(c::Base.GenericCondition{ReentrantLock}; first::Bool)
   @ Base .\condition.jl:141
 [4] wait
   @ .\condition.jl:136 [inlined]
 [5] put_buffered(c::Channel{Any}, v::Int64)
   @ Base .\channels.jl:420
 [6] put!(c::Channel{Any}, v::Int64)
   @ Base .\channels.jl:398
 [7] put!(rv::DistributedNext.RemoteValue, args::Int64)
   @ DistributedNext D:\a\DistributedNext.jl\DistributedNext.jl\src\remotecall.jl:703
 [8] (::DistributedNext.var"#create_worker##11#create_worker##12"{DistributedNext.RemoteValue, Float64})()
   @ DistributedNext D:\a\DistributedNext.jl\DistributedNext.jl\src\cluster.jl:721
```

Replaced it with a call to `timedwait()`, which has the advantage of being a lot
simpler than an extra task.
@JamesWrigley JamesWrigley added the bug Something isn't working label Jan 6, 2025
@JamesWrigley JamesWrigley self-assigned this Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.24%. Comparing base (3a43532) to head (766f8c3).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #117      +/-   ##
==========================================
- Coverage   79.33%   79.24%   -0.09%     
==========================================
  Files          10       10              
  Lines        1916     1913       -3     
==========================================
- Hits         1520     1516       -4     
- Misses        396      397       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JamesWrigley JamesWrigley merged commit 51fe0e4 into master Jan 6, 2025
7 of 8 checks passed
@JamesWrigley JamesWrigley deleted the timeout branch January 6, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants