You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/08/18 14:57:52 UTC
[GitHub] [servicecomb-java-chassis] xuzhiyonggithubper opened a new issue #1925: What Do I Do If a Bug Occurs When Executors Execute Asynchronous Tasks That Contain RestTemplate Invoking?
xuzhiyonggithubper opened a new issue #1925:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1925
**english
scenario:microservice invoke
problems:A task is split into multiple tasks. Executors is used to execute one of the tasks. The task is an asynchronous task (the task is blocked until condition A occurs). When RestTemplate is used to invoke other microservices in the asynchronous task, a bug with an unknown cause occurs.
chinese
场景:微服务调用
问题:将一个任务分解,使用Executors执行其中的一个任务,这个任务是异步任务(调用之后直接阻塞,直到发生条件A),在异步任务中使用RestTemplate调用其他微服务,出现不明原因的bug。**
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] xuzhiyonggithubper commented on issue #1925: What Do I Do If a Bug Occurs When Executors Execute Asynchronous Tasks That Contain RestTemplate Invoking?
Posted by GitBox <gi...@apache.org>.
xuzhiyonggithubper commented on issue #1925:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1925#issuecomment-675535403
Executors es
ArrayList<Callable<String>> list=new ArrayList<>()
list.add(new Watch());
es.invaokeall(list)
futures.for
future.get
invoke other microservice appear exception
class Watch is a asynchronous task
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] xuzhiyonggithubper commented on issue #1925: What Do I Do If a Bug Occurs When Executors Execute Asynchronous Tasks That Contain RestTemplate Invoking?
Posted by GitBox <gi...@apache.org>.
xuzhiyonggithubper commented on issue #1925:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1925#issuecomment-675795619
main方法中执行,伪代码如下,使用Executors执行特定任务,特定任务实现Callable接口。如果不使用线程函数式从上往下结果正常。
Executors es
ArrayList<Callable> list=new ArrayList<>()
list.add(new Watch());
es.invaokeall(list)
futures.for
future.get
invoke other microservice appear exception
//future中调用其他微服务,会出现不正常的日志,函数式从上往下正常。watch是个执行即阻塞的方法(直到满足A添条件)
class Watch is a asynchronous task
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1925: What Do I Do If a Bug Occurs When Executors Execute Asynchronous Tasks That Contain RestTemplate Invoking?
Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1925:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1925#issuecomment-675795233
你是不是在 Reactive 调用的回调部分代码里写了个同步调用啊?Reactive 调用的回调代码是跑在 eventloop 线程里的,因此不能阻塞,在这里发起同步调用可能会把 eventloop 线程挂住,日志里面会打印 vertx 的报错信息,显示eventloop 线程被 block
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org