Skip to content

Commit

Permalink
nfs: propagate NFS errors of server-side-copy to the client
Browse files Browse the repository at this point in the history
Motivation:
when server-side-copy with an NFS error, like NOT_SUPP, then we want
this error to be propagated to the client.

Modification:
Update OperationCOPY to map only non NFS errors to EIO.

Result:
proper error handling.

Acked-by: Albert Rossi
Target: master
  • Loading branch information
kofemann committed Oct 25, 2022
1 parent 4247348 commit 225dcf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/org/dcache/nfs/v4/OperationCOPY.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ public void process(CompoundContext context, nfs_resop4 result) throws ChimeraNF
long n = copyFuture.get(1, TimeUnit.SECONDS);
res.cr_resok4.cr_response.wr_count = new length4(n);
} catch (InterruptedException | ExecutionException e) {
LOGGER.error("Copy-offload interrupted: ", Throwables.getRootCause(e));

Throwable cause = Throwables.getRootCause(e);
Throwables.propagateIfPossible(cause, ChimeraNFSException.class);

LOGGER.error("Copy-offload failed: {}", e.getMessage());
res.cr_status = nfsstat.NFSERR_IO;
} catch (TimeoutException e) {
// continue as async copy
Expand Down

0 comments on commit 225dcf1

Please sign in to comment.