Merge pull request #1959 from segevfiner/logs-read-timeout

Fix getting a read timeout for logs/attach with a tty and slow output
This commit is contained in:
Anca Iordache 2021-09-17 12:58:19 +02:00 committed by GitHub
commit b27faa62e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -397,6 +397,12 @@ class APIClient(
def _stream_raw_result(self, response, chunk_size=1, decode=True):
''' Stream result for TTY-enabled container and raw binary data'''
self._raise_for_status(response)
# Disable timeout on the underlying socket to prevent
# Read timed out(s) for long running processes
socket = self._get_raw_response_socket(response)
self._disable_socket_timeout(socket)
yield from response.iter_content(chunk_size, decode)
def _read_from_socket(self, response, stream, tty=True, demux=False):