interrupted system call w/ Queue.get

Jean-Paul Calderone calderone.jeanpaul at
Fri Feb 18 09:23:06 EST 2011

On Feb 17, 8:46 pm, Philip Winston <pwins... at> wrote:
> We have a multiprocess Python program that uses Queue to communicate
> between processes.  Recently we've seen some errors while blocked
> waiting on Queue.get:
> IOError: [Errno 4] Interrupted system call
> What causes the exception?  Is it necessary to catch this exception
> and manually retry the Queue operation?  Thanks.

The exception is caused by a syscall returning EINTR.  A syscall will
return EINTR when a signal arrives and interrupts whatever that
was trying to do.  Typically a signal won't interrupt the syscall
unless you've installed a signal handler for that signal.  However,
you can avoid the interruption by using `signal.siginterrupt` to
disable interruption on that signal after you've installed the

As for the other questions - I don't know, it depends how and why it
happens, and whether it prevents your application from working


More information about the Python-list mailing list