Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add kernel_info_timeout traitlet for slow kernel start/restart#3665

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
minrk merged 1 commit intojupyter:masterfrommpacer:reply_timeout
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add kernel_info_timeout traitlet to wait for slow kernel startups
This affects both the MappingKernelManager and the ZMQChannelsHandler(by extension). This allows one setting to apply to both startup andrestarting.
  • Loading branch information
@mpacer
mpacer committedJun 6, 2018
commitc6dd032bf8cb14b9134d6267c5cbcf157fc31aef
3 changes: 2 additions & 1 deletionnotebook/services/kernels/handlers.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,7 +104,8 @@ class ZMQChannelsHandler(AuthenticatedZMQStreamHandler):

@property
defkernel_info_timeout(self):
returnself.settings.get('kernel_info_timeout',10)
km_default=self.kernel_manager.kernel_info_timeout
returnself.settings.get('kernel_info_timeout',km_default)

@property
defiopub_msg_rate_limit(self):
Expand Down
17 changes: 14 additions & 3 deletionsnotebook/services/kernels/kernelmanager.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,7 +19,7 @@
from jupyter_client.session import Session
from jupyter_client.multikernelmanager import MultiKernelManager
from traitlets import (Any, Bool, Dict, List, Unicode, TraitError, Integer,
Instance, default, validate
Float,Instance, default, validate
)

from notebook.utils import to_os_path, exists
Expand DownExpand Up@@ -93,6 +93,18 @@ def _update_root_dir(self, proposal):
no frontends are connected.
"""
)

kernel_info_timeout = Float(60, config=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Excellent!

help="""Timeout for giving up on a kernel (in seconds).

On starting and restarting kernels, we check whether the
kernel is running and responsive by sending kernel_info_requests.
This sets the timeout in seconds for how long the kernel can take
before being presumed dead.
This affects the MappingKernelManager (which handles kernel restarts)
and the ZMQChannelsHandler (which handles the startup).
"""
)

_kernel_buffers = Any()
@default('_kernel_buffers')
Expand DownExpand Up@@ -305,7 +317,7 @@ def on_restart_failed():
kernel.session.send(channel, "kernel_info_request")
channel.on_recv(on_reply)
loop = IOLoop.current()
timeout = loop.add_timeout(loop.time() +30, on_timeout)
timeout = loop.add_timeout(loop.time() +self.kernel_info_timeout, on_timeout)
return future

def notify_connect(self, kernel_id):
Expand DownExpand Up@@ -434,4 +446,3 @@ def cull_kernel_if_idle(self, kernel_id):
self.log.warning("Culling '%s' kernel '%s' (%s) with %d connections due to %s seconds of inactivity.",
kernel.execution_state, kernel.kernel_name, kernel_id, connections, idle_duration)
self.shutdown_kernel(kernel_id)


[8]ページ先頭

©2009-2025 Movatter.jp