Skip to content

Commit 2b2d321

Browse files
authored
Merge pull request #2326 from jupyter/revert-2293-stream-data-rate
Revert "only consider stream output for data rate limit"
2 parents de61e20 + 15341ac commit 2b2d321

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

notebook/notebookapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ def _update_server_extensions(self, change):
997997
limited.""")
998998

999999
iopub_data_rate_limit = Float(1000000, config=True, help="""(bytes/sec)
1000-
Maximum rate at which stream output can be sent on iopub before they are
1000+
Maximum rate at which messages can be sent on iopub before they are
10011001
limited.""")
10021002

10031003
rate_limit_window = Float(3, config=True, help="""(sec) Time window used to

notebook/services/kernels/handlers.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,7 @@ def write_stderr(error_message):
336336

337337
# Increment the bytes and message count
338338
self._iopub_window_msg_count += 1
339-
if msg_type == 'stream':
340-
byte_count = sum([len(x) for x in msg_list])
341-
else:
342-
byte_count = 0
339+
byte_count = sum([len(x) for x in msg_list])
343340
self._iopub_window_byte_count += byte_count
344341

345342
# Queue a removal of the byte and message count for a time in the
@@ -360,12 +357,7 @@ def write_stderr(error_message):
360357
The notebook server will temporarily stop sending output
361358
to the client in order to avoid crashing it.
362359
To change this limit, set the config variable
363-
`--NotebookApp.iopub_msg_rate_limit`.
364-
365-
Current values:
366-
NotebookApp.iopub_msg_rate_limit={} (msgs/sec)
367-
NotebookApp.rate_limit_window={} (secs)
368-
""".format(self.iopub_msg_rate_limit, self.rate_limit_window)))
360+
`--NotebookApp.iopub_msg_rate_limit`."""))
369361
else:
370362
# resume once we've got some headroom below the limit
371363
if self._iopub_msgs_exceeded and msg_rate < (0.8 * self.iopub_msg_rate_limit):
@@ -382,12 +374,7 @@ def write_stderr(error_message):
382374
The notebook server will temporarily stop sending output
383375
to the client in order to avoid crashing it.
384376
To change this limit, set the config variable
385-
`--NotebookApp.iopub_data_rate_limit`.
386-
387-
Current values:
388-
NotebookApp.iopub_data_rate_limit={} (bytes/sec)
389-
NotebookApp.rate_limit_window={} (secs)
390-
""".format(self.iopub_data_rate_limit, self.rate_limit_window)))
377+
`--NotebookApp.iopub_data_rate_limit`."""))
391378
else:
392379
# resume once we've got some headroom below the limit
393380
if self._iopub_data_exceeded and data_rate < (0.8 * self.iopub_data_rate_limit):

0 commit comments

Comments
 (0)