Opened 11 years ago

Last modified 11 years ago

#2354 defect new

Handling of EINTR in

Reported by: dkosovic Owned by: dkosovic
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:


The select loop in twisted/internet/ (or in SVN trunk) which handles EINTR returns immediately rather than retrying again with a continue statement e.g like the continue in the attached patch.

For me on Fedora Core 6 with wxPython, _doSelectInThread only occasionally does one successful iteration because of EINTR return statement.

Attachments (1)

twisted-EINTR.patch (485 bytes) - added by dkosovic 11 years ago.

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by dkosovic

Attachment: twisted-EINTR.patch added

comment:1 Changed 11 years ago by Jean-Paul Calderone

What do you mean "only occasionally does one successful iteration"? The reactor is going to end up in select again pretty soon after _doSelectInThread returns. Why does this need to be a continue instead of a return?

comment:2 Changed 11 years ago by dkosovic

The problem is with the AccessGrid toolkit has with the EINTR. The following is a comment from an AccessGrid developer in regards to the patch in AccessGrid bug #1484:

The problem is that the event client gets interrupted by a signal (SIGRT_1) and never continues. It never continues because of the handling of the socket.error(EINTR) in the twisted threadedselectreactor interleave loop. This patch addresses that problem by allowing the loop to continue operating.

Ignore my comment "About only occasionally does one successful iteration". I thought the AccessGrid Toolkit worked correctly the first time it went through that code, but not on subsequent attempts, but I think I was mistaken.

comment:3 Changed 11 years ago by Glyph

Owner: changed from Glyph to dkosovic

This patch needs tests.

Note: See TracTickets for help on using tickets.