Skip to content

Commit

Permalink
pool: don't treat InterruptedIOException as a disk IO error
Browse files Browse the repository at this point in the history
Motivation:
When a thread performing I/O get interrupted, then
InterruptedIOException might be thrown. DCAP mover will treat such
exception as a disk I/O error and propagate as such, thus, disabling the
pool.

Modification:
treat InterruptedIOException as interrupt and cancel only the mover.

Result:
reduce false positive disk IO errors.

Acked-by: Lea Morschel
Target: master, 10.1, 10.0, 9.2
Require-book: no
Require-notes: yes
  • Loading branch information
kofemann committed Oct 2, 2024
1 parent f745948 commit fb734fb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import dmg.cells.nucleus.CellPath;
import java.io.EOFException;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
Expand Down Expand Up @@ -723,7 +724,7 @@ private void doTheReadv(RepositoryChannel fileChannel, DCapOutputByteBuffer cntO
if (rc <= 0) {
break;
}
} catch (ClosedByInterruptException ee) {
} catch (ClosedByInterruptException | InterruptedIOException ee) {
// clear interrupted state
Thread.interrupted();
throw new InterruptedException(ee.getMessage());
Expand Down Expand Up @@ -917,7 +918,7 @@ private void doTheWrite(RepositoryChannel fileChannel,

_bigBuffer.flip();
bytesAdded += fileChannel.write(_bigBuffer);
} catch (ClosedByInterruptException ee) {
} catch (ClosedByInterruptException | InterruptedIOException ee) {
// clear interrupted state
Thread.interrupted();
throw new InterruptedException(ee.getMessage());
Expand Down

0 comments on commit fb734fb

Please sign in to comment.