From 297eac05504b778de8db727f0f3daf6ab348a3c9 Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Mon, 30 Sep 2024 19:36:46 +0200 Subject: [PATCH] pool: don't treat InterruptedIOException as a disk IO error 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 (cherry picked from commit fb734fb6c6f480b02676f86d4b29bb6d819c69ee) Signed-off-by: Tigran Mkrtchyan --- .../main/java/org/dcache/pool/movers/DCapProtocol_3_nio.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/dcache-dcap/src/main/java/org/dcache/pool/movers/DCapProtocol_3_nio.java b/modules/dcache-dcap/src/main/java/org/dcache/pool/movers/DCapProtocol_3_nio.java index aa93f307ed2..b3503b5086d 100644 --- a/modules/dcache-dcap/src/main/java/org/dcache/pool/movers/DCapProtocol_3_nio.java +++ b/modules/dcache-dcap/src/main/java/org/dcache/pool/movers/DCapProtocol_3_nio.java @@ -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; @@ -730,7 +731,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()); @@ -924,7 +925,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());