Git Product home page Git Product logo

Comments (4)

zhangxu19830126 avatar zhangxu19830126 commented on July 20, 2024

代码片段对于seata的回复第二阶段的ACK消息,不需要处理失败的情况,如果失败,服务会ACK超时,会重新触发流程,重新给seata客户端发送第二阶段的回滚或者提交请求

from seata-go-server.

JerryZhou343 avatar JerryZhou343 commented on July 20, 2024

代码片段对于seata的回复第二阶段的ACK消息,不需要处理失败的情况,如果失败,服务会ACK超时,会重新触发流程,重新给seata客户端发送第二阶段的回滚或者提交请求

我的疑问不是流程上的疑问,是代码上的疑问。 前面描述的两个代码片段中,片段1没有在入队失败情况下调用releaseCMD , 片段二 在失败情况下调用了releaseCMD, 两处不一样的原因是什么呢?

from seata-go-server.

zhangxu19830126 avatar zhangxu19830126 commented on July 20, 2024

由于ACK不需要关注错误的情况,所以可以偷懒少写一点代码,对于正确性不产生影响。仅此而已。第二种情况,需要处理错误是因为需要调用callback,把错误告诉客户端。而 ACK的逻辑不需要回复客户端。

from seata-go-server.

JerryZhou343 avatar JerryZhou343 commented on July 20, 2024

由于ACK不需要关注错误的情况,所以可以偷懒少写一点代码,对于正确性不产生影响。仅此而已。第二种情况,需要处理错误是因为需要调用callback,把错误告诉客户端。而 ACK的逻辑不需要回复客户端。

了解;可以统一下吧。要么都回收到sync.pool, 要么都不回收了得了。
P.S. 多谢解答

from seata-go-server.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.