program crashes with "bzr: ERROR: socket.error: (4, 'Interrupted system call')"

Bug #583941 reported by Jelmer Vernooij
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Andrew Bennetts
2.1
Fix Released
Medium
Andrew Bennetts

Bug Description

From http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577110:

Trying to get the latest emacs source with:

    bzr branch http://bzr.savannah.gnu.org/r/emacs/trunk

bzr crashes with:

    bzr: ERROR: socket.error: (4, 'Interrupted system call')

This has happened three time this afternoon. First was about 3 minutes
into the dowload, the last after more than an hour. Traceback attached.

Related branches

Jelmer Vernooij (jelmer)
Changed in bzr:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Martin Packman (gz) wrote :

The cause of the EINTR is likely the same as in bug 572055, and the mitigation for that seems to be in 2.1.1 already so not much more we can do there.

The root problem is in socket._fileobject as tracked in <http://bugs.python.org/issue1628205> which is fixed in Python trunk, and the problem with our mitigation is tracked in <http://bugs.python.org/issue8354> which is fixed in Python trunk and the 2.6 branch.

When Debian finally upgrade to 2.6 this problem should vanish for them, but gettting the first Python bug fix backported as well would be good. Otherwise the only options are ripping out the SIGWINCH code, or changing bzrlib.transport.http._urllib2_wrappers not to use socket._fileobject but something more robust.

Revision history for this message
Andrew Bennetts (spiv) wrote : Re: [Bug 583941] Re: program crashes with "bzr: ERROR: socket.error: (4, 'Interrupted system call')"

Martin [gz] wrote:
[...]
> Otherwise the only options are ripping out the SIGWINCH code, or

I'm pretty tempted to do that, and maybe replace it with a small C
module that can install a simple SIGWINCH handler that avoids Python's
bugs. The module would just set a “terminal sized changed” flag that
bzrlib.osutils.terminal_width() would check before returning a result.

Revision history for this message
Andrew Bennetts (spiv) wrote :

I've gone ahead and implemented that C module.

Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
status: Triaged → In Progress
Revision history for this message
Andrew Bennetts (spiv) wrote :

Fix merged into 2.2b3.

Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.