Comment 5 for bug 495023

Revision history for this message
Andrew Bennetts (spiv) wrote : Re: [Bug 495023] Re: Interrupting commit to smart server sometimes removes files

John A Meinel wrote:
[...]
>
> ^- This specifically sounds like we are suppressing the exception
> somewhere, and we shouldn't be. And so we end up not processing a
> directory because of the exception, but the calling code isn't
> propagating the exception and so it keeps going even though we've
> omitted a dir.

I agree. I've just taken a quick look through the error handling in
_dirstate_helpers_pyx.pyx and _readdir_pyx.pyx (both native “except”
blocks and the checking of return values of various C calls), but I
haven't spotted any obvious problems.

But maybe the way _readdir_pyx handles EINTR from readdir isn't quite
right. I'm not sure, but I think we may need to call PyErr_CheckSignals
if we get EINTR, otherwise the signal that just arrived (potentially
SIGINT, i.e. KeyboardInterrupt) may not be noticed until some arbitrary
point later, causing KeyboardInterrupt at strange times? I've attached
a patch to _readdir_pyx.pyx that tries this.

-Andrew.