Skip to content

Commit 135bcd9

Browse files
authored
bugfix: resolve issue#6925
bugfix: resolve issue in Raft model a follower's crash may lead to the continued use of expired tokens (apache#6925)
1 parent f127e50 commit 135bcd9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

discovery/seata-discovery-raft/src/main/java/org/apache/seata/discovery/registry/raft/RaftRegistryServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ private static void refreshToken(String tcAddress) throws RetryableException {
414414
Map<String, String> header = new HashMap<>();
415415
header.put(HTTP.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
416416
String response = null;
417-
tokenTimeStamp = System.currentTimeMillis();
418417
try (CloseableHttpResponse httpResponse =
419418
HttpClientUtil.doPost("http://" + tcAddress + "/api/v1/auth/login", param, header, 1000)) {
420419
if (httpResponse != null) {
@@ -427,6 +426,7 @@ private static void refreshToken(String tcAddress) throws RetryableException {
427426
throw new AuthenticationFailedException("Authentication failed! you should configure the correct username and password.");
428427
}
429428
jwtToken = jsonNode.get("data").asText();
429+
tokenTimeStamp = System.currentTimeMillis();
430430
} else {
431431
//authorized failed,throw exception to kill process
432432
throw new AuthenticationFailedException("Authentication failed! you should configure the correct username and password.");

0 commit comments

Comments
 (0)