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

killing notebook is unreliable #270

Closed
YingzhouLi opened this issue Feb 5, 2015 · 12 comments
Closed

killing notebook is unreliable #270

YingzhouLi opened this issue Feb 5, 2015 · 12 comments

Comments

@YingzhouLi
Copy link

After I run notebook() in Julia and close the notebook, my Julia will be extremely slow.
I have no idea if this is caused by my improperly exiting notebook (I always use ctrl+c in the terminal to interrupt it).
The following error message pop-up when the notebook is interrupted:
ERROR: interrupt
in process_events at ./stream.jl:537
in wait at ./task.jl:273
in wait at ./task.jl:194
in stream_wait at ./stream.jl:263
in wait at ./process.jl:619
in success at process.jl:492
in notebook at /home/ryanli/.julia/v0.3/IJulia/src/IJulia.jl:177
in notebook at /home/ryanli/.julia/v0.3/IJulia/src/IJulia.jl:176

@stevengj
Copy link
Member

stevengj commented Feb 5, 2015

I think the background event-processing tasks are still running... no, that's not it, since the IJulia kernel is actually in a separate process.

@stevengj stevengj changed the title Julia is extremely slow killing notebook makes Julia is extremely slow Mar 3, 2015
@stevengj stevengj changed the title killing notebook makes Julia is extremely slow killing notebook makes Julia extremely slow Mar 3, 2015
@stevengj stevengj changed the title killing notebook makes Julia extremely slow killing notebook is unreliable Mar 3, 2015
@stevengj
Copy link
Member

stevengj commented Mar 3, 2015

Right now, if you want to kill the notebook you should really just close Julia entirely; the notebook() command is not designed to be interruptable. Possibly the problem here is due to the unreliability of ctrl-C in Julia when killing C code (see JuliaLang/julia#2622).

Maybe the right thing is for notebook() to fork a process that runs asynchronously, and return a task object that can be stopped with something like stop_notebook(). @Keno or @vtjnash , do you have any ideas on why

run(`ipython...`)

would be problematic to interrupt, and whether there is a better way to isolate it?

@vtjnash
Copy link
Member

vtjnash commented Mar 3, 2015

Perhaps you want to add a detach() to that Cmd object? I don't know how you are interrupting the code currently

@stevengj
Copy link
Member

stevengj commented Mar 3, 2015

@vtjnash, people are just interrupting run with ctrl-c right now.

@vtjnash
Copy link
Member

vtjnash commented Mar 3, 2015

Oh. Yes, it should have a detach call then so that signals don't propagate to the child processes

@stevengj
Copy link
Member

stevengj commented Mar 3, 2015

But if you run detach, then even closing Julia will not kill it, which will be confusing for users (who will soon have dozens of ipython processes running). Is there an intermediate choice? I want it to be killable (reliably), and to die when Julia dies (at least by default).

The problem is not that I don't like ctrl-c, it is that ctrl-c is leaving Julia in a non-functional state.

@vtjnash
Copy link
Member

vtjnash commented Mar 3, 2015

True. Currently Julia workers kill themselves when they see a SIGPIPE. Can IPython do something similar?

@stevengj
Copy link
Member

stevengj commented Mar 3, 2015

I think IPython exits cleanly only on SIGINT or SIGTERM; see ipython/ipython#1609

@amitmurthy
Copy link

@vtjnash , we changed julia processes to ignore SIGPIPE. But they do exit when the socket connected to the master process is closed, actually on any error in the the task blocking on a read from the master.

@amitmurthy
Copy link

related - JuliaLang/julia#9095

@stevengj
Copy link
Member

This still seems to be a problem on MacOS due to JuliaLang/julia#18146 ... the notebook() command ends up killing the wrong process.

@stevengj stevengj reopened this Aug 19, 2016
@stevengj
Copy link
Member

Okay, the problem on my machine seems to be because (for historical reasons) my IJulia was running the notebook via ipython notebook. When I reconfigured it to use jupyter notebook, the problem went away. So, I'm going to close this as hopefully it is unlikely to affect people using a modern Jupyter version.

I still think that there should be a way to kill a whole process group, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants