ProjectRepairer: Report an interrupted copy as InterruptedIOException
copy() declares InterruptedException, but the only one that escapes
comes from the halt() call in its own catch block, leaving copyInOrder()
to catch an interrupt it takes no part in. The interrupt copy() does
take part in becomes a -1 exit code, and as throwing
InterruptedException clears the interrupt status, nothing above can tell
an interrupted transfer from a failed one, or that the repair was
cancelled at all.
Absorb the halt() interrupt where it happens, and report the copy's own
interrupt as InterruptedIOException, which is what java.io raises when
an interrupt terminates a transfer. It unwinds the repair, so the copies
and destinations left after a cancel are skipped instead of running to
completion.
The SSH command lets it escape, which BaseCommand already treats as the
client having dropped off, exiting 127 without logging. Auto-repair logs
the interrupt and skips its follow-up replication.
Change-Id: Ie61e0329aaa3131c8ac1f8b4932e57e48c5e5e0b
3 files changed