From 287bcf14a104e27618fc7e12b1a0b741dfec2c78 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 12 May 2023 07:40:48 +0200 Subject: [PATCH] api: avoid socket timeouts when executing commands (https://github.com/docker/docker-py/pull/3125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only listen to read events when polling a socket in order to avoid incorrectly trying to read from a socket that is not actually ready. Cherry-picked from https://github.com/docker/docker-py/commit/c5e582c413a4a3a9eff6ee8208d195f657ffda94 Co-authored-by: Loïc Leyendecker --- plugins/module_utils/_api/utils/socket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/_api/utils/socket.py b/plugins/module_utils/_api/utils/socket.py index 9001a9b93..9193ce30e 100644 --- a/plugins/module_utils/_api/utils/socket.py +++ b/plugins/module_utils/_api/utils/socket.py @@ -48,7 +48,7 @@ def read(socket, n=4096): select.select([socket], [], []) else: poll = select.poll() - poll.register(socket) + poll.register(socket, select.POLLIN | select.POLLPRI) poll.poll() try: