bitterfox commented on a change in pull request #3677:
URL: https://github.com/apache/hadoop/pull/3677#discussion_r757208812
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferClient.java
##########
@@ -603,7 +603,17 @@ private IOStreamPair doSaslHandshake(InetAddress addr,
conf, cipherOption, underlyingOut, underlyingIn, false) :
sasl.createStreamPair(out, in);
} catch (IOException ioe) {
- sendGenericSaslErrorMessage(out, ioe.getMessage());
+ try {
Review comment:
I found another case that slow might happen.
- Server failed to retrieve password and send accessTokenError to client
- Client receive ERROR + accessTokenError=true and
InvalidBlockTokenException is thrown
- Reach to this catch clausure
- Client send generic sasl error message to server
- However server closes peer if exception happens in sasl handshake
-
https://github.com/apache/hadoop/blob/c9d64bad37fbfbaa77481f67338b39a029d7dc51/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L297-L336
- Client got IOException due to "Broken pipe" and this IOException is
thrown to caller instead of ioe which is InvalidToken
- So token is not refreshed and all datanodes are considered as dead nodes.
This is difficult to reproduce with current code because of the timing
issue, but you can reproduce by changing this code to
```
} catch (IOException ioe) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
sendGenericSaslErrorMessage(out, ioe.getMessage());
throw ioe;
}
```
Then TestSaslDataTransferExpiredBlockToken will be failed.
We need to suppress exception from sendGenericSaslErrorMessage and throw ioe
always
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]