Skip to content

Commit

Permalink
nfs-proxy: remove proxy adapter on IO errors
Browse files Browse the repository at this point in the history
If we lost connection to pool, then makes no sense to
keep adapter which always returns IO error

Ticket: #8607
Acked-by: Karsten Schwank
Target: master, 2.11, 2.10
Require-book: no
Require-notes: no
(cherry picked from commit 88daff7)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
  • Loading branch information
kofemann committed Feb 4, 2015
1 parent 9a28806 commit 7064cd3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Expand Up @@ -194,6 +194,13 @@ public void notifyDisposed(NFS4State state) {
}
}

void shutdownAdapter(stateid4 stateid) {
ProxyIoAdapter adapter = _proxyIO.getIfPresent(stateid);
if (adapter != null) {
_proxyIO.invalidate(stateid);
tryToClose(adapter);
}
}
@Override
public void getInfo(PrintWriter pw) {
pw.println(" Known proxy adapters (proxy-io):");
Expand Down
Expand Up @@ -102,6 +102,7 @@ public void process(CompoundContext context, nfs_resop4 result) {
_log.debug(he.getMessage());
}catch(IOException ioe) {
_log.error("DSREAD: ", ioe);
proxyIoFactory.shutdownAdapter(_args.opread.stateid);
res.status = nfsstat.NFSERR_IO;
}catch(Exception e) {
_log.error("DSREAD: ", e);
Expand Down
Expand Up @@ -111,6 +111,7 @@ public void process(CompoundContext context, nfs_resop4 result) {
_log.debug(he.getMessage());
}catch(IOException ioe) {
_log.error("DSWRITE: {}", ioe.getMessage());
proxyIoFactory.shutdownAdapter(_args.opwrite.stateid);
res.status = nfsstat.NFSERR_IO;
}catch(Exception e) {
_log.error("DSWRITE: ", e);
Expand Down

0 comments on commit 7064cd3

Please sign in to comment.