We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCC callBranch 会通过 transRequestBranch 发起请求 最后会 通过 invoke 执行到 _simpleRequest _simpleRequest 里服务端出错客户端不会抛出异常
GrpcApi transRequestBranch
public function transRequestBranch(RequestBranch $requestBranch) { [$hostname, $method] = $this->parseHostnameAndMethod($requestBranch->url); $client = $this->grpcClientManager->getClient($hostname); $response = $client->invoke($method, $requestBranch->grpcArgument, $requestBranch->grpcDeserialize, $requestBranch->grpcMetadata, $requestBranch->grpcOptions); dump($response); }
TCC globalTransaction
public function globalTransaction(callable $callback, ?string $gid = null) { $this->init($gid); $requestBody = TransContext::toArray(); try { $this->api->prepare($requestBody); $callback($this); } catch (\Throwable $throwable) { $this->api->abort($requestBody); throw $throwable; } $this->api->submit($requestBody); }
globalTransaction 的 callback 执行 _simpleRequest,即使服务端出现异常客户端也不会抛出来,所以catch 里永远不会捕获到异常 导致 abort 永远不会执行,最终会走到 submit
The text was updated successfully, but these errors were encountered:
建议 gRPC 客户端可以配置,进行自定义处理。
Sorry, something went wrong.
我目前的 gRPC 客户端是复制了 hyperf 的进行自定义处理定制的。可能要通过 class_map 来进行自定义的替换 DTM 的 gRPC 客户端
hyperf/hyperf#5013 这个 PR 希望可以通过,进行继承扩展。因为有些 private 的方法导致只能复制,个人维护起来也麻烦
我目前自定义的客户端,使用了统一的异常,Server 抛出的异常客户端也会转换为相应的异常,我的方案对于我可行,不确定 hyperf 的 gRPC 是否愿意接受相关的 PR
No branches or pull requests
TCC callBranch 会通过 transRequestBranch 发起请求
最后会 通过 invoke 执行到 _simpleRequest
_simpleRequest 里服务端出错客户端不会抛出异常
GrpcApi transRequestBranch
TCC globalTransaction
globalTransaction 的 callback 执行 _simpleRequest,即使服务端出现异常客户端也不会抛出来,所以catch 里永远不会捕获到异常
导致 abort 永远不会执行,最终会走到 submit
The text was updated successfully, but these errors were encountered: