Skip to content

Commit

Permalink
Avoid socket timeouts when executing commands
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Loïc Leyendecker <loic.leyendecker@gmail.com>
  • Loading branch information
loicleyendecker committed May 10, 2023
1 parent 9cadad0 commit abe10ac
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docker/utils/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def read(socket, n=4096):
select.select([socket], [], [])
else:
poll = select.poll()
poll.register(socket)
poll.poll()
poll.register(socket, select.POLLIN | select.POLLPRI)

try:
if hasattr(socket, 'recv'):
Expand Down

0 comments on commit abe10ac

Please sign in to comment.