Merge lp:~spiv/bzr/no_until_no_eintr into lp:bzr
Status: | Merged |
---|---|
Approved by: | Martin Pool |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~spiv/bzr/no_until_no_eintr |
Merge into: | lp:bzr |
Diff against target: |
424 lines (+126/-66) 5 files modified
NEWS (+10/-3) bzrlib/osutils.py (+77/-18) bzrlib/smart/medium.py (+30/-44) bzrlib/smart/protocol.py (+7/-1) bzrlib/smart/server.py (+2/-0) |
To merge this branch: | bzr merge lp:~spiv/bzr/no_until_no_eintr |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman (community) | Needs Information | ||
Martin Pool | Approve | ||
Review via email: mp+21699@code.launchpad.net |
Commit message
(andrew) Either correctly handle EINTR or don't handle it at all. (#496813)
Description of the change
This change removes the unsafe uses of until_no_eintr, based on the bug reports and patches from the very patient Martin <gz>. Unlike Martin <gz>'s original patch it doesn't remove the until_no_eintr helper entirely, because it is safe (and useful) to use for reading from a pipe.
(In other changes we've already reduced the number of signal handlers we install that will trigger EINTR, but it can still occur, so, when practical, we may as well handle it correctly rather than fail.)
The most alarming diff hunk is:
- return '\x01'.join(args) + '\n'
+ joined = '\x01'.join(args) + '\n'
+ if type(joined) is unicode:
+ # XXX: We should fix things so this never happens! -AJB, 04032010.
+ mutter('response args contain unicode, should be only bytes: %r',
+ joined)
+ joined = joined.
+ return joined
This is a latent bug in the HPSS protocol v1 (and maybe v2) code now exposed by the change to use buffer() in send_all. This change explicitly does the convert-to-ASCII that was being done anyway. v3 is unaffected.
The diff applies cleanly to 2.1 (aside from the NEWS entry, of course), and I'll submit a backport for review once this proposal is accepted.
nice