HDFS-12744. More logs when short-circuit read is failed and disabled. Contributed by Weiwei Yang.

This commit is contained in:
Weiwei Yang 2017-11-01 16:41:45 +08:00
parent 20304b91cc
commit 56b88b0670
2 changed files with 4 additions and 1 deletions

View File

@ -646,7 +646,8 @@ public class BlockReaderFactory implements ShortCircuitReplicaCreator {
default: default:
LOG.warn(this + ": unknown response code " + resp.getStatus() + LOG.warn(this + ": unknown response code " + resp.getStatus() +
" while attempting to set up short-circuit access. " + " while attempting to set up short-circuit access. " +
resp.getMessage()); resp.getMessage() + ". Disabling short-circuit read for DataNode "
+ datanode + " temporarily.");
clientContext.getDomainSocketFactory() clientContext.getDomainSocketFactory()
.disableShortCircuitForPath(pathInfo.getPath()); .disableShortCircuitForPath(pathInfo.getPath());
return null; return null;

View File

@ -387,6 +387,8 @@ class DataXceiver extends Receiver implements Runnable {
} catch (IOException e) { } catch (IOException e) {
bld.setStatus(ERROR); bld.setStatus(ERROR);
bld.setMessage(e.getMessage()); bld.setMessage(e.getMessage());
LOG.error("Request short-circuit read file descriptor" +
" failed with unknown error.", e);
} }
bld.build().writeDelimitedTo(socketOut); bld.build().writeDelimitedTo(socketOut);
if (fis != null) { if (fis != null) {