Merge lp:~spiv/bzr/siginterrupt-to-avoid-eintr-496813-2.0 into lp:bzr/2.0
Proposed by
Andrew Bennetts
Status: | Rejected |
---|---|
Rejected by: | Andrew Bennetts |
Proposed branch: | lp:~spiv/bzr/siginterrupt-to-avoid-eintr-496813-2.0 |
Merge into: | lp:bzr/2.0 |
Diff against target: |
94 lines (+42/-2) 3 files modified
NEWS (+16/-0) bzrlib/breakin.py (+4/-2) bzrlib/osutils.py (+22/-0) |
To merge this branch: | bzr merge lp:~spiv/bzr/siginterrupt-to-avoid-eintr-496813-2.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrew Bennetts | Disapprove | ||
John A Meinel | Approve | ||
Martin Packman (community) | Abstain | ||
Review via email: mp+20103@code.launchpad.net |
To post a comment you must log in.
This patch adds a new function: bzrlib. osutils. set_signal_ handler( signum, handler, allow_restart= True). When allow_restart=True (the default), it will call signal. siginterrupt( signum, False) after registering the signal handler, preventing EINTR[1].
In lp:bzr/2.0 there's only one problematic signal handler registered in bzrlib, the SIGQUIT handler. (Later versions can also register a SIGWINCH handler, my merge proposal for those versions will take that into account.)
Separately, we should remove the buggy uses until_no_eintr (and perhaps the entire function), but this patch doesn't depend on doing that to be a useful fix (in fact it should make uses of until_no_eintr, buggy or not, irrelevant).
[1] the signal(7) man page says EINTR is still possible in some cases (search for SA_RESTART), but none of the cases where it might still happen seem to be relevant to us.