Skip to content

Commit

Permalink
Merge pull request #2910 from mheilman/cull_idle_timeout_minimum
Browse files Browse the repository at this point in the history
change cull_idle_timeout_minimum to 1 from 300
  • Loading branch information
takluyver committed Nov 1, 2017
2 parents 9a5c2c0 + b31194d commit bfe012e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions notebook/services/kernels/kernelmanager.py
Expand Up @@ -61,11 +61,10 @@ def _update_root_dir(self, proposal):
raise TraitError("kernel root dir %r is not a directory" % value)
return value

cull_idle_timeout_minimum = 300 # 5 minutes
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
will be set to the minimum."""
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
Expand All @@ -75,12 +74,12 @@ def _update_root_dir(self, proposal):

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."""
)

buffer_offline_messages = Bool(True, config=True,
Expand Down Expand Up @@ -381,10 +380,6 @@ def initialize_culler(self):
"""
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).",
Expand Down

0 comments on commit bfe012e

Please sign in to comment.