Skip to content

Commit 63618b5

Browse files
committed
Fix getting a read timeout for logs/attach with a tty and slow output
Fixes #931 Signed-off-by: Segev Finer <[email protected]>
1 parent 264688e commit 63618b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docker/api/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,12 @@ def _multiplexed_response_stream_helper(self, response):
397397
def _stream_raw_result(self, response, chunk_size=1, decode=True):
398398
''' Stream result for TTY-enabled container and raw binary data'''
399399
self._raise_for_status(response)
400+
401+
# Disable timeout on the underlying socket to prevent
402+
# Read timed out(s) for long running processes
403+
socket = self._get_raw_response_socket(response)
404+
self._disable_socket_timeout(socket)
405+
400406
yield from response.iter_content(chunk_size, decode)
401407

402408
def _read_from_socket(self, response, stream, tty=True, demux=False):

0 commit comments

Comments
 (0)