Problems interrupting pmap with Ctrl-C #6752 Closed amitmurthy opened this Issue on May 5, 2014 · 7 comments Projects None yet Labels bug needs tests parallel Milestone 0.4.x Assignees No one assigned 7 participants @amitmurthy @vtjnash @StefanKarpinski @simonster @ihnorton @tkelman @bjarthur Notifications You’re not receiving notifications from this thread. @amitmurthy The Julia Language member amitmurthy commented on May 5, 2014 • edited 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 The Julia Language member vtjnash commented on May 5, 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 The Julia Language member StefanKarpinski commented on Jun 12, 2014 Bump. Would be nice to have a fix for this. Interrupting a long-running distributed task is pretty common. @JeffBezanson JeffBezanson referenced this issue on Jun 16, 2014 Closed Parallel and time macro segfault #7261 @simonster simonster added this to the 0.4 milestone on Aug 1, 2014 @simonster simonster added the parallel label on Aug 1, 2014 @simonster The Julia Language member simonster commented on Sep 26, 2014 Bump. This is really annoying. @ihnorton ihnorton added the bug label on Dec 30, 2014 @ihnorton The Julia Language member ihnorton commented on Dec 30, 2014 Related (dupe?) #6283 @tkelman The Julia Language member tkelman commented on May 12 @amitmurthy have recent refactorings improved the situation here at all? @vtjnash vtjnash added a commit that referenced this issue on Jun 13 @vtjnash reconnect REPL backend consumer reference to client.jl 8df4c40 @bjarthur bjarthur commented on Jun 15 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 bjarthur commented on Jun 15 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. @vtjnash vtjnash added a commit that closed this issue on Jun 15 @vtjnash reconnect REPL backend consumer reference to client.jl 0d519e1 @vtjnash vtjnash closed this in 0d519e1 on Jun 15 @tkelman tkelman added the needs-tests label on Jun 15