From 241c7e162cf75f7164715a407d72cb1398ac3668 Mon Sep 17 00:00:00 2001 From: Michael Heilman Date: Mon, 9 Oct 2017 13:05:15 -0500 Subject: [PATCH 1/3] change cull_idle_timeout_minimum to 1 from 500 --- notebook/services/kernels/kernelmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/services/kernels/kernelmanager.py b/notebook/services/kernels/kernelmanager.py index 6f47ed6a7..9459c09fa 100644 --- a/notebook/services/kernels/kernelmanager.py +++ b/notebook/services/kernels/kernelmanager.py @@ -61,10 +61,10 @@ class MappingKernelManager(MultiKernelManager): raise TraitError("kernel root dir %r is not a directory" % value) return value - cull_idle_timeout_minimum = 300 # 5 minutes + cull_idle_timeout_minimum = 1 cull_idle_timeout = Integer(0, config=True, help="""Timeout (in seconds) after which a kernel is considered idle and ready to be culled. Values of 0 or - lower disable culling. The minimum timeout is 300 seconds (5 minutes). Positive values less than the minimum value + lower disable culling. The minimum timeout is 1 second. Positive values less than the minimum value will be set to the minimum.""" ) From f8ef57359212c70841552a3a8a57195b94693efc Mon Sep 17 00:00:00 2001 From: Michael Heilman Date: Wed, 11 Oct 2017 09:54:45 -0500 Subject: [PATCH 2/3] added warning about culling kernels with poor network connections --- notebook/services/kernels/kernelmanager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notebook/services/kernels/kernelmanager.py b/notebook/services/kernels/kernelmanager.py index 9459c09fa..16728458d 100644 --- a/notebook/services/kernels/kernelmanager.py +++ b/notebook/services/kernels/kernelmanager.py @@ -65,7 +65,8 @@ class MappingKernelManager(MultiKernelManager): cull_idle_timeout = Integer(0, config=True, help="""Timeout (in seconds) after which a kernel is considered idle and ready to be culled. Values of 0 or lower disable culling. The minimum timeout is 1 second. Positive values less than the minimum value - will be set to the minimum.""" + will be set to the minimum. Very short timeouts may result in kernels being culled for users with poor + network connections.""" ) cull_interval_default = 300 # 5 minutes From b31194dfe3063ac5acedb1f6d04f246f79e16095 Mon Sep 17 00:00:00 2001 From: Michael Heilman Date: Fri, 20 Oct 2017 08:51:04 -0500 Subject: [PATCH 3/3] removed extraneous cull_idle_timeout_minimum --- notebook/services/kernels/kernelmanager.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/notebook/services/kernels/kernelmanager.py b/notebook/services/kernels/kernelmanager.py index 16728458d..d507b1cb3 100644 --- a/notebook/services/kernels/kernelmanager.py +++ b/notebook/services/kernels/kernelmanager.py @@ -61,12 +61,10 @@ class MappingKernelManager(MultiKernelManager): raise TraitError("kernel root dir %r is not a directory" % value) return value - cull_idle_timeout_minimum = 1 cull_idle_timeout = Integer(0, config=True, - help="""Timeout (in seconds) after which a kernel is considered idle and ready to be culled. Values of 0 or - lower disable culling. The minimum timeout is 1 second. Positive values less than the minimum value - will be set to the minimum. Very short timeouts may result in kernels being culled for users with poor - network connections.""" + help="""Timeout (in seconds) after which a kernel is considered idle and ready to be culled. + Values of 0 or lower disable culling. Very short timeouts may result in kernels being culled + for users with poor network connections.""" ) cull_interval_default = 300 # 5 minutes @@ -76,12 +74,12 @@ class MappingKernelManager(MultiKernelManager): cull_connected = Bool(False, config=True, help="""Whether to consider culling kernels which have one or more connections. - Only effective if cull_idle_timeout is not 0.""" + Only effective if cull_idle_timeout > 0.""" ) cull_busy = Bool(False, config=True, help="""Whether to consider culling kernels which are busy. - Only effective if cull_idle_timeout is not 0.""" + Only effective if cull_idle_timeout > 0.""" ) _kernel_buffers = Any() @@ -366,10 +364,6 @@ class MappingKernelManager(MultiKernelManager): """ if not self._initialized_culler and self.cull_idle_timeout > 0: if self._culler_callback is None: - if self.cull_idle_timeout < self.cull_idle_timeout_minimum: - self.log.warning("'cull_idle_timeout' (%s) is less than the minimum value (%s) and has been set to the minimum.", - self.cull_idle_timeout, self.cull_idle_timeout_minimum) - self.cull_idle_timeout = self.cull_idle_timeout_minimum loop = IOLoop.current() if self.cull_interval <= 0: #handle case where user set invalid value self.log.warning("Invalid value for 'cull_interval' detected (%s) - using default value (%s).",