Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to configure the IOPub timeout #513

Merged
merged 1 commit into from
Jan 16, 2017
Merged
Changes from all 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
13 changes: 12 additions & 1 deletion nbconvert/preprocessors/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ class ExecutePreprocessor(Preprocessor):
)
).tag(config=True)

iopub_timeout = Integer(4, allow_none=False,
help=dedent(
"""
The time to wait (in seconds) for IOPub output. This generally
doesn't need to be set, but on some slow networks (such as CI
systems) the default timeout might not be long enough to get all
messages.
"""
)
).tag(config=True)

shutdown_kernel = Enum(['graceful', 'immediate'],
default_value='graceful',
help=dedent(
Expand Down Expand Up @@ -275,7 +286,7 @@ def run_cell(self, cell):
# in certain CI systems, waiting < 1 second might miss messages.
# So long as the kernel sends a status:idle message when it
# finishes, we won't actually have to wait this long, anyway.
msg = self.kc.iopub_channel.get_msg(timeout=4)
msg = self.kc.iopub_channel.get_msg(timeout=self.iopub_timeout)
except Empty:
self.log.warn("Timeout waiting for IOPub output")
if self.raise_on_iopub_timeout:
Expand Down