Skip to content
Snippets Groups Projects
Commit 3ef3bf70 authored by Jun Wu's avatar Jun Wu
Browse files

commandserver: do not handle EINTR for selector.select

selectors2 library handles EINTR transparently so we don't need to handle
select.error ourselves.
parent b11e8c67
Branches
Tags
No related merge requests found
......@@ -11,7 +11,6 @@
import gc
import os
import random
import select
import signal
import socket
import struct
......@@ -488,4 +487,10 @@
# waiting for recv() will receive ECONNRESET.
self._unlinksocket()
exiting = True
ready = selector.select(timeout=h.pollinterval)
if not ready:
# only exit if we completed all queued requests
if exiting:
break
continue
try:
......@@ -491,8 +496,2 @@
try:
ready = selector.select(timeout=h.pollinterval)
if not ready:
# only exit if we completed all queued requests
if exiting:
break
continue
conn, _addr = self._sock.accept()
......@@ -498,5 +497,5 @@
conn, _addr = self._sock.accept()
except (select.error, socket.error) as inst:
except socket.error as inst:
if inst.args[0] == errno.EINTR:
continue
raise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment