Tornado Interrupted system call

2019-06-26 10:09发布

问题:

I'm getting this error from time to time and not sure how can be debugged.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/tornado/ioloop.py", line 662, in start
    event_pairs = self._impl.poll(poll_timeout)
IOError: [Errno 4] Interrupted system call

Does anyone know what this means / when is happening?

I'm using python 2.7 and tornado 3.2.1

Update: This code is in ioloop.py

try:
    event_pairs = self._impl.poll(poll_timeout)
except Exception as e:
    # Depending on python version and IOLoop implementation,
    # different exception types may be thrown and there are
    # two ways EINTR might be signaled:
    # * e.errno == errno.EINTR
    # * e.args is like (errno.EINTR, 'Interrupted system call')
    if (getattr(e, 'errno', None) == errno.EINTR or
          (isinstance(getattr(e, 'args', None), tuple) and
          len(e.args) == 2 and e.args[0] == errno.EINTR)):
        continue
    else:
        raise

回答1:

It seems you should upgrade your version of Tornado; this bug (EINTR returned from poll) appears to be fixed in the latest versions.