api: avoid socket timeouts when executing commands (#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.

Signed-off-by: Loïc Leyendecker <loic.leyendecker@gmail.com>
This commit is contained in:
loicleyendecker 2023-05-11 18:36:37 +01:00 committed by GitHub
parent 9cadad009e
commit c5e582c413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ def read(socket, n=4096):
select.select([socket], [], []) select.select([socket], [], [])
else: else:
poll = select.poll() poll = select.poll()
poll.register(socket) poll.register(socket, select.POLLIN | select.POLLPRI)
poll.poll() poll.poll()
try: try: