Skip to content

Commit

Permalink
api: avoid socket timeouts when executing commands (docker/docker-py#…
Browse files Browse the repository at this point in the history
…3125)

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 docker/docker-py@c5e582c

Co-authored-by: Loïc Leyendecker <loic.leyendecker@gmail.com>
  • Loading branch information
felixfontein and loicleyendecker committed May 12, 2023
1 parent f04af24 commit 287bcf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/module_utils/_api/utils/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 287bcf1

Please sign in to comment.