feign远程调用,事务回滚不生效
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the A-to-B Feign call with JDK 1.8, TX-LCN 5.0.2, Spring Boot 2.0.4.RELEASE, Spring Cloud Finchley.SR1, and Eureka. Compare the transaction and rollback logs from both services; done means an exception in B also causes A's transaction to roll back.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100