Skip to content

Commit 6d235e3

Browse files
committed
pool: separate cases for disk error and no space available
Motivation when there are no avvailable space on a pool, the pool will go to DISABLED mode and no data could be read anymore. This is wrong we still want to be able to read data from the file. Modification this is a temp change, trying to get the info from the eroor message, sice therer is no a specific error code, and then based on that info separate two cases DISABLED AND READONLY Acked-by: Tigran Mkrtchyan Target: master. 10.2, 10.1, 10.0, 9.2 Require-book: no Require-notes: yes Commited:master@862963e
1 parent 54f4a14 commit 6d235e3

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

modules/dcache-vehicles/src/main/java/diskCacheV111/util/DiskErrorCacheException.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,27 @@
1414
*/
1515
public class DiskErrorCacheException extends CacheException {
1616

17+
1718
private static final long serialVersionUID = -5386946146340646052L;
1819

20+
public enum FileStoreState {
21+
READ_ONLY, FAILED
22+
}
23+
1924
public DiskErrorCacheException(String msg) {
2025
super(CacheException.ERROR_IO_DISK, msg);
2126
}
2227

2328
public DiskErrorCacheException(String message, Throwable cause) {
2429
super(CacheException.ERROR_IO_DISK, message, cause);
2530
}
31+
32+
public FileStoreState checkStatus(String message) {
33+
if (message.contains("No space available.")) {
34+
return FileStoreState.READ_ONLY;
35+
} else {
36+
return FileStoreState.FAILED;
37+
}
38+
}
39+
2640
}

modules/dcache/src/main/java/org/dcache/pool/classic/MoverRequestScheduler.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,19 @@ public void failed(Throwable exc, Void attachment) {
513513
.setTransferStatus(CacheException.DEFAULT_ERROR_CODE,
514514
"Transfer was killed");
515515
} else if (exc instanceof DiskErrorCacheException) {
516+
FaultAction faultAction = null;
517+
//TODO this is done because the FileStoreState is in another module
518+
// to be improved
519+
switch (((DiskErrorCacheException) exc).checkStatus(exc.getMessage())){
520+
case READ_ONLY:
521+
faultAction = FaultAction.READONLY;
522+
break;
523+
default:
524+
faultAction = FaultAction.DISABLED;
525+
break;
526+
}
516527
FaultEvent faultEvent = new FaultEvent("transfer",
517-
FaultAction.DISABLED, exc.getMessage(), exc);
528+
faultAction, exc.getMessage(), exc);
518529
_faultListeners.forEach(l -> l.faultOccurred(faultEvent));
519530
}
520531
postprocess();
@@ -532,9 +543,18 @@ public void completed(Void result, Void attachment) {
532543
@Override
533544
public void failed(Throwable exc, Void attachment) {
534545
if (exc instanceof DiskErrorCacheException) {
546+
FaultAction faultAction = null;
547+
switch (((DiskErrorCacheException) exc).checkStatus(exc.getMessage())){
548+
case READ_ONLY:
549+
faultAction = FaultAction.READONLY;
550+
break;
551+
default:
552+
faultAction = FaultAction.DISABLED;
553+
break;
554+
}
535555
FaultEvent faultEvent = new FaultEvent(
536556
"post-processing",
537-
FaultAction.DISABLED,
557+
faultAction,
538558
exc.getMessage(), exc);
539559
_faultListeners.forEach(
540560
l -> l.faultOccurred(faultEvent));

0 commit comments

Comments
 (0)