codingapi / codingapi/tx-lcn

feign远程调用,事务回滚不生效

オープン
#340 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
4.2k
フォーク
1.4k
PR マージ指標
30日以内にマージされた PR はありません

説明

### 1. Bug Description
>a服务调用b服务,b服务的事务抛异常,a服务的事务不会回滚

### 2. Environment:
- JDK version: **1.8**
- OS: **win7**
- TX-LCN version: **5.0.2**
- Others:
> springboot:**2.0.4.RELEASE**
> springcloud: **Finchley.SR1**
>注册中心:**eureka**

### 3. Exception Stacktrace
>a服务调用b服务的方式是feign,b服务的日志输出如下:
```
2019-04-08 16:27:41.922 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tracing.Tracings [51] -| tracing apply group:154e4aad55f537, app map:e30=
2019-04-08 16:27:41.923 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.aspect.weave.DTXLogicWeaver [60] -| <---- TxLcn start ---->
2019-04-08 16:27:41.924 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.context.DefaultGlobalContext [150] -| Start TxContext[154e4aad55f537]
2019-04-08 16:27:41.924 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.DTXServiceExecutor [59] -| pre business code, unit type: lcn @group(154e4aad55f537)
2019-04-08 16:27:41.926 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.aspect.weave.DTXResourceWeaver [50] -| proxy a sql connection: com.codingapi.txlcn.tc.core.transaction.lcn.resource.LcnConnectionProxy@79cdd3f5.
2019-04-08 16:27:41.928 |-DEBUG [http-nio-9002-exec-3] com.test.service.e.mapper.ExUserMapper.addUserByXml [159] -| ==> Preparing: insert into user(name,age,score) values(?,?,?)
2019-04-08 16:27:41.929 |-DEBUG [http-nio-9002-exec-3] com.test.service.e.mapper.ExUserMapper.addUserByXml [159] -| ==> Parameters: 10(String), 10(Integer), null
2019-04-08 16:27:41.932 |-DEBUG [http-nio-9002-exec-3] com.test.service.e.mapper.ExUserMapper.addUserByXml [159] -| <== Updates: 1
2019-04-08 16:27:41.936 |-ERROR [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.DTXServiceExecutor [70] -| business code error @group(154e4aad55f537)
2019-04-08 16:27:41.944 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.template.TransactionCleanTemplate [59] -| clean transaction @group(154e4aad55f537)
2019-04-08 16:27:41.944 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.transaction.lcn.resource.LcnConnectionProxy [50] -| rollback transaction type[lcn] proxy connection:com.codingapi.txlcn.tc.core.transaction.lcn.resource.LcnConnectionProxy@79cdd3f5.
2019-04-08 16:27:41.949 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.transaction.lcn.resource.LcnConnectionProxy [54] -| transaction type[lcn] proxy connection:com.codingapi.txlcn.tc.core.transaction.lcn.resource.LcnConnectionProxy@79cdd3f5 closed.
2019-04-08 16:27:41.950 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.template.TransactionCleanTemplate [59] -| clean transaction over @group(154e4aad55f537)
2019-04-08 16:27:41.950 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.context.DefaultGlobalContext [162] -| Destroy TxContext[154e4aad55f537]
2019-04-08 16:27:41.951 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.core.DTXLocalContext [170] -| clean thread local[DTXLocalContext]: DTXLocalContext(transactionType=lcn, groupId=154e4aad55f537, unitId=63104376c261440a03d3308f64fa602f, resource=null, destroy=true, inGroup=false, attachment=null, sysTransactionState=1, userTransactionState=-1, proxy=true, justNow=false, proxyTmp=false)
2019-04-08 16:27:41.951 |-DEBUG [http-nio-9002-exec-3] com.codingapi.txlcn.tc.aspect.weave.DTXLogicWeaver [113] -| <---- TxLcn end ---->
2019-04-08 16:27:41.959 |-ERROR [http-nio-9002-exec-3] com.test.cloud.common.exception.GlobalExceptionHandler [33] -| / by zero
java.lang.ArithmeticException: / by zero
```

### 4. Tour Idea

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、JDK 1.8、TX-LCN 5.0.2、Spring Boot 2.0.4.RELEASE、Spring Cloud Finchley.SR1、Eureka を使用して A から B への Feign 呼び出しを再現します。両方のサービスのトランザクションとロールバックのログを比較します。B での例外によって A のトランザクションもロールバックされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, spring-boot
領域
api, backend, distributed-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。