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
  • Loading branch information
kofemann committed Feb 4, 2015
1 parent a8197a0 commit 88daff7
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 @@ -103,6 +103,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 @@ -112,6 +112,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 88daff7

Please sign in to comment.