Skip to content

Commit

Permalink
pool: remove fault-injection in dcap mover
Browse files Browse the repository at this point in the history
Motivation:
DCAP mover as a fault injection code that added for testing purposes,
however, it only makes code more complicated.

Modification:
Remove fault-injection code in dcap mover.

Result:
less doggy code.

Acked-by: Lea Morschel
Target: master
Require-book: no
Require-notes: yes
  • Loading branch information
kofemann committed Oct 1, 2024
1 parent 17b79d5 commit 4a9305c
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class DCapProtocol_3_nio implements MoverProtocol, ChecksumMover, CellArg
private String _status = "None";
private boolean _io_ok = true;
private Exception ioException = null;
private long _ioError = -1;

private PnfsId _pnfsId;
private int _sessionId = -1;

Expand Down Expand Up @@ -259,13 +259,6 @@ public void runIO(FileAttributes fileAttributes,
// Prepare the tunable parameters //
// //

try {
String io = storage.getKey("io-error");
if (io != null) {
_ioError = Long.parseLong(io);
}
} catch (NumberFormatException e) { /* bad values are ignored */}
_log.info("ioError = {}", _ioError);
MoverIoBuffer bufferSize = new MoverIoBuffer(_defaultBufferSize);
_log.info("Client : Buffer Sizes : {}", bufferSize);
_bigBuffer = ByteBuffer.allocate(bufferSize.getIoBufferSize());
Expand Down Expand Up @@ -938,10 +931,6 @@ private void doTheWrite(RepositoryChannel fileChannel,
}
rest -= rc;
_bytesTransferred += rc;
if ((_ioError > 0L) &&
(_bytesTransferred > _ioError)) {
_io_ok = false;
}
}

_log.debug("Block Done");
Expand Down Expand Up @@ -996,10 +985,6 @@ private void doTheRead(RepositoryChannel fileChannel,
socketChannel.write(_bigBuffer);
rest -= rc;
_bytesTransferred += rc;
if ((_ioError > 0L) && (_bytesTransferred > _ioError)) {
_io_ok = false;
break;
}
if (rest <= 0) {
break;
}
Expand Down

0 comments on commit 4a9305c

Please sign in to comment.