Skip to content

Commit abe10ac

Browse files
Avoid socket timeouts when executing commands
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 <[email protected]>
1 parent 9cadad0 commit abe10ac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docker/utils/socket.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def read(socket, n=4096):
3737
select.select([socket], [], [])
3838
else:
3939
poll = select.poll()
40-
poll.register(socket)
41-
poll.poll()
40+
poll.register(socket, select.POLLIN | select.POLLPRI)
4241

4342
try:
4443
if hasattr(socket, 'recv'):

0 commit comments

Comments
 (0)