apache / apache/incubator-seata-samples

业务层调用FeignClient没加GlobalTransactional注解就报错

Open
#410 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
2.4k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

当前业务层服务通过feignclient调用其它服务,方法上或类上没有配置GlobalTransactional注解就报错,
![image](https://user-images.githubusercontent.com/73679143/101748031-ff0fcc00-3b06-11eb-987f-6d6e5cbc16dd.png)
Exception in thread "hystrix-chaos-oauth2-server-1" java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Failed executing wrapped Action0
at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction.call(HystrixContexSchedulerAction.java:71)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
... 5 more
Caused by: java.lang.IllegalArgumentException: xid must be not blank
at io.seata.core.context.RootContext.bind(RootContext.java:92)
at com.alibaba.cloud.seata.feign.hystrix.SeataHystrixConcurrencyStrategy$SeataContextCallable.call(SeataHystrixConcurrencyStrategy.java:72)
at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction.call(HystrixContexSchedulerAction.java:69)
... 6 more
2020-12-10 16:40:25.199 [HystrixTimer-1] ERROR com.netflix.hystrix.util.HystrixTimer - Failed while ticking TimerListener
java.lang.RuntimeException: java.lang.IllegalArgumentException: xid must be not blank
at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable.run(HystrixContextRunnable.java:59)
at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$2.tick(AbstractCommand.java:1159)
at com.netflix.hystrix.util.HystrixTimer$1.run(HystrixTimer.java:99)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: xid must be not blank
at io.seata.core.context.RootContext.bind(RootContext.java:92)
at com.alibaba.cloud.seata.feign.hystrix.SeataHystrixConcurrencyStrategy$SeataContextCallable.call(SeataHystrixConcurrencyStrategy.java:72)
at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable.run(HystrixContextRunnable.java:57)
... 9 common frames omitted

Contributor guide

Open the contributing guide

Research direction

Start from the reported stack trace in SeataHystrixConcurrencyStrategy$SeataContextCallable and RootContext.bind, then inspect how a Feign call without GlobalTransactional propagates context through Hystrix. Reproduce the failure in the relevant sample and verify that the call no longer raises the xid-must-be-not-blank error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.