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 11, 2023
1 parent 9cadad0 commit e8b6d33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/utils/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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 e8b6d33

Please sign in to comment.