IOError: [Errno 4] Interrupted system call

Greg Weeks weeks at vitus.scs.agilent.com
Fri Feb 8 22:27:34 EST 2002


In Python 1.5.2, I'm getting the message

    IOError: [Errno 4] Interrupted system call

in a context that doesn't make sense to me.  My program has two threads
(which won't appear useful out of context):

Thread 1: Fork a subprocess, wait for the subprocess to exit, and set
an Event.

Thread 2: Send a SIGTERM signal to the subprocess and wait for the Event to
be set.

I'm getting the error message from Thread 2 while waiting for the event.
The relevant portions of the stack trace are:

  <In my code: self.event.wait(10)>
  File "/opt/Python-1.5.2/Lib/threading.py", line 298, in wait
    self.__cond.wait(timeout)
  File "/opt/Python-1.5.2/Lib/threading.py", line 199, in wait
    _sleep(delay)

_sleep is just time.sleep.

What is strange about this is that the Python process should not be
receiving any signals.  Only the subprocess receives a signal.  So I
can't imagine what might be going on.  Any ideas?


Greg


PS: It is guaranteed that the fork has returned before SIGTERM is sent.

PS: The error is intermittent and occurs only if SIGTERM is sent very soon
after the fork has returned.



More information about the Python-list mailing list