Skip to content

Commit bdfc60d

Browse files
authored
Merge pull request #391 from fanchenggang/master
FIX 当 dtx timeout.时抛出LcnBusinessException异常之后 第二次ex.getCause() 会抛java…
2 parents 8951756 + ee961bf commit bdfc60d

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionControlTemplate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public void notifyGroup(String groupId, String unitId, String transactionType, i
143143
txLogger.txTrace(
144144
groupId, unitId, "notify group > transaction type: {}, state: {}.", transactionType, state);
145145
if (globalContext.isDTXTimeout()) {
146+
txLogger.trace(groupId, unitId, Transactions.TE, "dtx timeout.");
146147
throw new LcnBusinessException("dtx timeout.");
147148
}
148149
state = reliableMessenger.notifyGroup(groupId, state);
@@ -153,7 +154,7 @@ public void notifyGroup(String groupId, String unitId, String transactionType, i
153154
dtxExceptionHandler.handleNotifyGroupMessageException(Arrays.asList(groupId, state, unitId, transactionType), e);
154155
} catch (LcnBusinessException e) {
155156
// 关闭事务组失败
156-
dtxExceptionHandler.handleNotifyGroupBusinessException(Arrays.asList(groupId, state, unitId, transactionType), e.getCause());
157+
dtxExceptionHandler.handleNotifyGroupBusinessException(Arrays.asList(groupId, state, unitId, transactionType), e);
157158
}
158159
txLogger.txTrace(groupId, unitId, "notify group exception state {}.", state);
159160
}

txlcn-txmsg-netty/src/main/java/com/codingapi/txlcn/txmsg/netty/bean/SocketManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public boolean noConnect(SocketAddress socketAddress) {
172172
* @param moduleName 模块名称
173173
* @return remoteKeys
174174
*/
175-
public List<String> removeKeys(String moduleName) {
175+
public List<String> remoteKeys(String moduleName) {
176176
List<String> allKeys = new ArrayList<>();
177177
for (Channel channel : channels) {
178178
if (moduleName.equals(getModuleName(channel))) {

txlcn-txmsg-netty/src/main/java/com/codingapi/txlcn/txmsg/netty/impl/NettyRpcClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public List<String> loadAllRemoteKey() {
9393

9494
@Override
9595
public List<String> remoteKeys(String moduleName) {
96-
return SocketManager.getInstance().removeKeys(moduleName);
96+
return SocketManager.getInstance().remoteKeys(moduleName);
9797
}
9898

9999

0 commit comments

Comments
 (0)