Skip to content

Commit

Permalink
srm: Improve error message on file_busy and duplication_errors
Browse files Browse the repository at this point in the history
I think these messages are more to the point. The duplication error
message is taken from the SRM spec.

Target: trunk
Request: 2.7
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6223/
  • Loading branch information
gbehrmann committed Nov 8, 2013
1 parent 74a070b commit 9099693
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Expand Up @@ -312,10 +312,9 @@ public void timeout() {

private void fileExists(PnfsMapPathMessage message) {

if(!overwrite) {
String errorString = String.format("file/directory %s exists, overwrite is not allowed ",path);
_log.debug(errorString);
callbacks.DuplicationError(errorString);
if (!overwrite) {
_log.debug("Path exists and overwrite is not permitted: {}", path);
callbacks.DuplicationError("SURL refers to an existing SURL and overwriting is not permitted.");
return;
}
//
Expand Down
Expand Up @@ -347,7 +347,7 @@ public final void run() throws NonFatalJobFailure, FatalJobFailure {
// [ SRM 2.2, 5.4.3] SRM_FILE_BUSY: client requests for a file which there is an
// active srmPrepareToPut (no srmPutDone is yet called) request for.
if (SRM.getSRM().isFileBusy(surl)) {
setStateAndStatusCode(State.FAILED, "The requested SURL is being used by another client.",
setStateAndStatusCode(State.FAILED, "The requested SURL is locked by an upload.",
TStatusCode.SRM_FILE_BUSY);
}

Expand Down
Expand Up @@ -383,7 +383,7 @@ public synchronized void run() throws NonFatalJobFailure, FatalJobFailure {
// [ SRM 2.2, 5.1.3] SRM_FILE_BUSY: client requests for a file which there is an
// active srmPrepareToPut (no srmPutDone is yet called) request for.
if (SRM.getSRM().isFileBusy(surl)) {
setStateAndStatusCode(State.FAILED, "The requested SURL is being used by another client.",
setStateAndStatusCode(State.FAILED, "The requested SURL is locked by an upload.",
TStatusCode.SRM_FILE_BUSY);
return;
}
Expand Down
Expand Up @@ -184,7 +184,7 @@ public synchronized void run() throws NonFatalJobFailure, FatalJobFailure {
metaDataPathDetail.setType(TFileType.FILE);
}
metaDataPathDetail.setStatus(new TReturnStatus(TStatusCode.SRM_FILE_BUSY,
"The requested SURL is being used by another client."));
"The requested SURL is locked by an upload."));
} else {
metaDataPathDetail =
getMetaDataPathDetail(surl,
Expand Down
Expand Up @@ -389,12 +389,12 @@ public void run() throws NonFatalJobFailure, FatalJobFailure
if (!getContainerRequest().isOverwrite()) {
setStateAndStatusCode(
State.FAILED,
"SURL exists already",
"The requested SURL is locked by another upload.",
TStatusCode.SRM_DUPLICATION_ERROR);
} else {
setStateAndStatusCode(
State.FAILED,
"The requested file is being used by another client.",
"The requested SURL is locked by another upload.",
TStatusCode.SRM_FILE_BUSY);
}
return;
Expand Down

0 comments on commit 9099693

Please sign in to comment.