|
@@ -65,6 +65,7 @@ import org.apache.hadoop.ipc.RemoteException;
|
|
import org.apache.hadoop.net.NetUtils;
|
|
import org.apache.hadoop.net.NetUtils;
|
|
import org.apache.hadoop.net.unix.DomainSocket;
|
|
import org.apache.hadoop.net.unix.DomainSocket;
|
|
import org.apache.hadoop.security.AccessControlException;
|
|
import org.apache.hadoop.security.AccessControlException;
|
|
|
|
+import org.apache.hadoop.security.token.SecretManager.InvalidToken;
|
|
import org.apache.hadoop.security.token.Token;
|
|
import org.apache.hadoop.security.token.Token;
|
|
import org.apache.hadoop.util.IdentityHashStore;
|
|
import org.apache.hadoop.util.IdentityHashStore;
|
|
|
|
|
|
@@ -590,7 +591,8 @@ implements ByteBufferReadable, CanSetDropBehind, CanSetReadahead,
|
|
// The encryption key used is invalid.
|
|
// The encryption key used is invalid.
|
|
refetchEncryptionKey--;
|
|
refetchEncryptionKey--;
|
|
dfsClient.clearDataEncryptionKey();
|
|
dfsClient.clearDataEncryptionKey();
|
|
- } else if (ex instanceof InvalidBlockTokenException && refetchToken > 0) {
|
|
|
|
|
|
+ } else if ((ex instanceof InvalidBlockTokenException || ex instanceof InvalidToken)
|
|
|
|
+ && refetchToken > 0) {
|
|
DFSClient.LOG.info("Will fetch a new access token and retry, "
|
|
DFSClient.LOG.info("Will fetch a new access token and retry, "
|
|
+ "access token was invalid when connecting to " + targetAddr
|
|
+ "access token was invalid when connecting to " + targetAddr
|
|
+ " : " + ex);
|
|
+ " : " + ex);
|
|
@@ -976,7 +978,8 @@ implements ByteBufferReadable, CanSetDropBehind, CanSetReadahead,
|
|
// The encryption key used is invalid.
|
|
// The encryption key used is invalid.
|
|
refetchEncryptionKey--;
|
|
refetchEncryptionKey--;
|
|
dfsClient.clearDataEncryptionKey();
|
|
dfsClient.clearDataEncryptionKey();
|
|
- } else if (e instanceof InvalidBlockTokenException && refetchToken > 0) {
|
|
|
|
|
|
+ } else if ((e instanceof InvalidBlockTokenException || e instanceof InvalidToken)
|
|
|
|
+ && refetchToken > 0) {
|
|
DFSClient.LOG.info("Will get a new access token and retry, "
|
|
DFSClient.LOG.info("Will get a new access token and retry, "
|
|
+ "access token was invalid when connecting to " + targetAddr
|
|
+ "access token was invalid when connecting to " + targetAddr
|
|
+ " : " + e);
|
|
+ " : " + e);
|