What Triggers Kernel Restart? · Issue #153 · Jupyter/help - GitHub

Skip to content Dismiss alert {{ message }} This repository was archived by the owner on Mar 26, 2019. It is now read-only. / help Public archive
  • Notifications You must be signed in to change notification settings
  • Fork 93
  • Star 290
  • Code
  • Issues 325
  • Pull requests
  • Actions
  • Projects
  • Security
  • Insights
Additional navigation options This repository was archived by the owner on Mar 26, 2019. It is now read-only. What triggers kernel restart? #153ClosedClosedWhat triggers kernel restart?#153@BoPeng

Description

@BoPengBoPengopened on Mar 24, 2017

I have been puzzled by this for quite a few days so it is perhaps better to ask for some help.

My kernel (http://github.com/vatlab/SOS) works most the time. I could see kernel created, kernel connected, and kernel ready, and I can use it properly. However, from time to time, when I start a new notebook with the sos kernel, the cell would be running forever with *, and sometimes with an output but with * in input, and I cannot execute any more cell. The problem happens most often when I start a cell and evaluate something very fast before the kernel is ready.

Now, from the JS console, I can see a kernel created event after kernel ready, and I cannot see a second kernel ready message (which is likely the problem)

Loading extension: jupyter-js-widgets/extension extension.js:88 loaded widgets main.min.js:22480 Kernel: kernel_connected (7185e96a-a60b-49ab-9d33-f46f4a002119) kernel.js?v=20170323223000:275 sos comm registered kernel.js?v=20170323223000:295 executor patched main.min.js:22480 Kernel: kernel_ready (7185e96a-a60b-49ab-9d33-f46f4a002119) kernel.js?v=20170323223000:284 kernel list requested 2manager-base.js:195 Widget backend and frontend versions are compatible main.min.js:22480 Kernel: kernel_created (7185e96a-a60b-49ab-9d33-f46f4a002119) main.min.js:22833 Starting WebSockets: ws://localhost:8888/api/kernels/7185e96a-a60b-49ab-9d33-f46f4a002119 main.min.js:22480 Kernel: kernel_connected (7185e96a-a60b-49ab-9d33-f46f4a002119) kernel.js?v=20170323223000:275 sos comm registered sos.js Failed to load resource: the server responded with a status of 404 (Not Found) :8888/kernelspecs/sos/kernel.js?v=20170323223000:181 kernel list updated :8888/nbextensions/jupyter-js-widgets/extension.js?v=20170323223000:264 Could not cross validate the widget frontend and backend versions. Error: Timeout while trying to cross validate the widget frontend and backend versions. at :8888/nbextensions/jupyter-js-widgets/extension.js?v=20170323223000:32285

so it appears to me that the first kernel is executing something, then the kernel is restarted for some reason, and the notebook cannot get the output from the preview session and hang forever.

From the terminal (with --debug option), I can see

[D 22:30:16.590 NotebookApp] Starting kernel: ['python', '-m', 'sos.jupyter.kernel', '-f', '/Users/bpeng1/Library/Jupyter/runtime/kernel-7185e96a-a60b-49ab-9d33-f46f4a002119.json'] [D 22:30:16.597 NotebookApp] Connecting to: tcp://127.0.0.1:51812 [I 22:30:16.599 NotebookApp] Kernel started: 7185e96a-a60b-49ab-9d33-f46f4a002119 [D 22:30:16.599 NotebookApp] Kernel args: {'kernel_name': 'sos', 'cwd': '/Users/bpeng1/sos'} [D 22:30:16.601 NotebookApp] 201 POST /api/sessions (::1) 38.22ms [D 22:30:16.605 NotebookApp] Serving kernel resource from: /Users/bpeng1/anaconda/share/jupyter/kernels/sos [D 22:30:16.606 NotebookApp] 200 GET /kernelspecs/sos/kernel.js?v=20170323223000 (::1) 3.58ms [D 22:30:16.608 NotebookApp] Path components/MathJax/extensions/Safe.js served from /Users/bpeng1/anaconda/lib/python3.6/site-packages/notebook/static/components/MathJax/extensions/Safe.js [D 22:30:16.609 NotebookApp] 304 GET /static/components/MathJax/extensions/Safe.js?rev=2.6.0 (::1) 2.53ms [D 22:30:16.611 NotebookApp] 200 GET /api/contents/Untitled.ipynb/checkpoints?_=1490326216233 (::1) 1.79ms [D 22:30:16.613 NotebookApp] Path jupyter-js-widgets/extension.js served from /Users/bpeng1/anaconda/share/jupyter/nbextensions/jupyter-js-widgets/extension.js [D 22:30:16.630 NotebookApp] Initializing websocket connection /api/kernels/7185e96a-a60b-49ab-9d33-f46f4a002119/channels [D 22:30:16.634 NotebookApp] Requesting kernel info from 7185e96a-a60b-49ab-9d33-f46f4a002119 [D 22:30:16.634 NotebookApp] Connecting to: tcp://127.0.0.1:51809 [D 22:30:16.644 NotebookApp] 200 GET /nbextensions/jupyter-js-widgets/extension.js?v=20170323223000 (::1) 32.30ms [D 22:30:16.671 NotebookApp] Path components/codemirror/addon/selection/active-line.js served from /Users/bpeng1/anaconda/lib/python3.6/site-packages/notebook/static/components/codemirror/addon/selection/active-line.js [D 22:30:16.673 NotebookApp] 200 GET /static/components/codemirror/addon/selection/active-line.js?v=20170323223000 (::1) 2.66ms [D 22:30:17.720 NotebookApp] Starting kernel: ['python', '-m', 'sos.jupyter.kernel', '-f', '/Users/bpeng1/Library/Jupyter/runtime/kernel-7185e96a-a60b-49ab-9d33-f46f4a002119.json'] [D 22:30:17.723 NotebookApp] Connecting to: tcp://127.0.0.1:51812 [I 22:30:17.724 NotebookApp] Kernel restarted: 7185e96a-a60b-49ab-9d33-f46f4a002119 [D 22:30:17.724 NotebookApp] Connecting to: tcp://127.0.0.1:51809 [D 22:30:17.726 NotebookApp] Path components/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png served from /Users/bpeng1/anaconda/lib/python3.6/site-packages/notebook/static/components/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png [D 22:30:17.727 NotebookApp] 304 GET /static/components/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png (::1) 1.36ms [D 22:30:19.650 NotebookApp] Received kernel info: {'status': 'ok', 'protocol_version': '5.0', 'implementation': 'SOS', 'implementation_version': '0.9.4', 'language_info': {'mimetype': 'text/x-sos', 'name': 'sos', 'file_extension': '.sos', 'pygments_lexer': 'sos', 'codemirror_mode': 'sos', 'nbconvert_exporter': 'sos.jupyter.converter.SoS_Exporter'}, 'banner': 'SoS kernel - script of scripts\nConnection file kernel-7185e96a-a60b-49ab-9d33-f46f4a002119.json', 'help_links': [{'text': 'Python', 'url': 'http://docs.python.org/3.6'}, {'text': 'IPython', 'url': 'http://ipython.org/documentation.html'}, {'text': 'NumPy', 'url': 'http://docs.scipy.org/doc/numpy/reference/'}, {'text': 'SciPy', 'url': 'http://docs.scipy.org/doc/scipy/reference/'}, {'text': 'Matplotlib', 'url': 'http://matplotlib.org/contents.html'}, {'text': 'SymPy', 'url': 'http://docs.sympy.org/latest/index.html'}, {'text': 'pandas', 'url': 'http://pandas.pydata.org/pandas-docs/stable/'}]} [D 22:30:19.651 NotebookApp] Opening websocket /api/kernels/7185e96a-a60b-49ab-9d33-f46f4a002119/channels [D 22:30:19.651 NotebookApp] Connecting to: tcp://127.0.0.1:51809 [D 22:30:19.652 NotebookApp] Connecting to: tcp://127.0.0.1:51810 [D 22:30:19.652 NotebookApp] Connecting to: tcp://127.0.0.1:51811 [D 22:30:19.675 NotebookApp] Kernel info reply received: 7185e96a-a60b-49ab-9d33-f46f4a002119 [D 22:30:19.675 NotebookApp] 200 POST /api/kernels/7185e96a-a60b-49ab-9d33-f46f4a002119/restart (::1) 2979.47ms ...

but I do not see any particular reason why the kernel is restarted after it seems to be running ok. I understand that there might be something wrong with my customized kernel but any insight or how I can continue to debug this problem would be highly apprecaited.

Many thanks in advance!

Metadata

Metadata

Assignees

No one assigned

Labels

No labelsNo labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You can’t perform that action at this time.

Tag » What Is Restart Kernel In Python