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

Problems interrupting pmap with Ctrl-C #6752

Closed
amitmurthy opened this issue May 5, 2014 · 7 comments
Closed

Problems interrupting pmap with Ctrl-C #6752

amitmurthy opened this issue May 5, 2014 · 7 comments
Labels
bug Indicates an unexpected problem or unintended behavior needs tests Unit tests are required for this change parallelism Parallel or distributed computation
Milestone

Comments

@amitmurthy
Copy link
Contributor

amitmurthy commented May 5, 2014

Unable to interrupt a pmap call with 2 or more workers

julia> addprocs(2)
julia> pmap(x-> while true; sleep(2000); end, 1:4)
^C^C^C^C^C^C^C^C^C^C^C^C

I added a debug statement to the sigint handler as well as the try-catch block in pmap. Looks like while the sigint handler is called everytime, only one the async tasks in pmap (for the first Ctrl-C) is being interrupted.

julia> addprocs(2)
julia> pmap(x-> while true; sleep(2000); end, 1:4)
^Cjl_defer_signal 0, jl_signal_pending 0, sig 2
InterruptException()
^Cjl_defer_signal 0, jl_signal_pending 0, sig 2
^Cjl_defer_signal 0, jl_signal_pending 0, sig 2
^Cjl_defer_signal 0, jl_signal_pending 0, sig 2
....

Are all the tasks interrupted upon a Ctrl-C? If so, then it could be a REPL bug too.

If not, the "main" task, which in the case of pmap is the REPL waiting on a @sync block should be interrupted, instead of a @async task chosen at random.

@vtjnash
Copy link
Member

vtjnash commented May 6, 2014

^C interrupts the currently executing task, which may be the last worker to block

@JeffBezanson maybe InterruptException should be propagated to the root task, if the current task is in the uv_run scheduler?

@StefanKarpinski
Copy link
Member

Bump. Would be nice to have a fix for this. Interrupting a long-running distributed task is pretty common.

@simonster simonster added this to the 0.4 milestone Aug 1, 2014
@simonster
Copy link
Member

Bump. This is really annoying.

@ihnorton ihnorton added the bug Indicates an unexpected problem or unintended behavior label Dec 30, 2014
@ihnorton
Copy link
Member

Related (dupe?) #6283

@tkelman
Copy link
Contributor

tkelman commented May 12, 2016

@amitmurthy have recent refactorings improved the situation here at all?

@bjarthur
Copy link
Contributor

possibly fixed. i get the following error on OS X for the latest master, and sth similar on linux:

julia> addprocs(2)
2-element Array{Int64,1}:
 2
 3

julia> pmap(x-> while true; sleep(2000); end, 1:4)
^C^C^C^Cfatal: error thrown and no exception handler available.
InterruptException()
jl_run_once at /Users/arthurb/src/julia/src/jl_uv.c:141
process_events at ./libuv.jl:82
wait at ./event.jl:100
task_done_hook at ./task.jl:161
unknown function (ip: 0x31ee9ecd9)
jl_call_method_internal at /Users/arthurb/src/julia/src/./julia_internal.h:93
jl_apply at /Users/arthurb/src/julia/src/./julia.h:1384
^C^C
atexit hook threw an error: InterruptException()^Cjl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
^Cjl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF
jl_uv_writecb() ERROR: bad file descriptor EBADF

@bjarthur
Copy link
Contributor

hold on. while on OS X it does return me to the command line, on linux it does not. rather, it keeps repeating the error message over and over.

@tkelman tkelman added the needs tests Unit tests are required for this change label Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior needs tests Unit tests are required for this change parallelism Parallel or distributed computation
Projects
None yet
Development

No branches or pull requests

7 participants