Skip to content

Commit 5da6eb6

Browse files
committed
only consider stream output for data rate limit
large stream outputs cause much more problems than image output this does open up to large HTML and/or displayed text output, but those seem to behave well more often than they don't.
1 parent 0800284 commit 5da6eb6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
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 messages can be sent on iopub before they are
1000+
Maximum rate at which stream output 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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ def write_stderr(error_message):
336336

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

342345
# Queue a removal of the byte and message count for a time in the

0 commit comments

Comments
 (0)