Skip to content

Commit

Permalink
bugfix: resolve issue in Raft model where follower crashes could lead…
Browse files Browse the repository at this point in the history
… client to continued use of expired tokens
  • Loading branch information
lixingjia authored and lixingjia77 committed Oct 15, 2024
1 parent 980ba23 commit 6696fc5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6899](https://github.com/apache/incubator-seata/pull/6899)] fix file.conf read failed after package
- [[#6890](https://github.com/apache/incubator-seata/pull/6890)] fix designerJson to standardJson: subStateMachine compensateState cannot be recognized
- [[#6907](https://github.com/apache/incubator-seata/pull/6907)] fix the issue of Codecov not generating reports
- [[#6925](https://github.com/apache/incubator-seata/pull/6925)] fix the issue in Raft model a follower's crash may lead to the continued use of expired tokens

### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] remove the branch registration operation of the XA read-only transaction
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [[#6899](https://github.com/apache/incubator-seata/pull/6899)] 修复file.conf打包后的读取
- [[#6890](https://github.com/apache/incubator-seata/pull/6890)] 修复saga设计json转标准json过程中: 子状态机补偿节点无法被识别
- [[#6907](https://github.com/apache/incubator-seata/pull/6907)] 修复Codecov未生成报告的问题
- [[#6925](https://github.com/apache/incubator-seata/pull/6925)] 修复Raft模式下,Follower崩溃可能导致Client继续使用过期令牌的问题

### optimize:
- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] 移除只读XA事务的分支注册操作
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ private static void refreshToken(String tcAddress) throws RetryableException {
Map<String, String> header = new HashMap<>();
header.put(HTTP.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
String response = null;
tokenTimeStamp = System.currentTimeMillis();
try (CloseableHttpResponse httpResponse =
HttpClientUtil.doPost("http://" + tcAddress + "/api/v1/auth/login", param, header, 1000)) {
if (httpResponse != null) {
Expand All @@ -427,6 +426,7 @@ private static void refreshToken(String tcAddress) throws RetryableException {
throw new AuthenticationFailedException("Authentication failed! you should configure the correct username and password.");
}
jwtToken = jsonNode.get("data").asText();
tokenTimeStamp = System.currentTimeMillis();
} else {
//authorized failed,throw exception to kill process
throw new AuthenticationFailedException("Authentication failed! you should configure the correct username and password.");
Expand Down

0 comments on commit 6696fc5

Please sign in to comment.