You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/29 01:55:10 UTC

[GitHub] [dubbo] AlbumenJ commented on issue #10142: 异步调用,分布式事务不存在,数据库回滚

AlbumenJ commented on issue #10142:
URL: https://github.com/apache/dubbo/issues/10142#issuecomment-1169449433

   事务的上下文传递不是 Dubbo 直接去做的,Dubbo 本身不会去直接耦合事务的状态。Dubbo 做的只是将 invocation 里面的参数都传递给服务端,至于服务端拿到后如何开启事务那是事务框架的事情。
   
   另外,在异步调用场景下,Dubbo是提供 onResponse 异步调用的,也就是 invoke 是一个同步过程,onResponse 在异步结果返回后再触发。也即是如果服务端处理很慢,消费端快速返回后 onResponse 也会等到服务端处理完才触发。(Seata有没有使用这个机制需要和 Seata 社区确认下)
   
   按照我的理解,对于异步场景下,调用端的事务不应该在请求快速返回后就被关闭的,因为都还不知道服务端是否真实处理完成,这里能返回只能说明 RPC 框架没问题,并不能保证服务端的真实实现没报错。那假设服务端报错了,即使在异步调用下,事务也应该被回滚的。


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org