coolbeevip commented on a change in pull request #607: WIP [SCB-1577] Improve
the transaction compensation mechanism for FSM
URL: https://github.com/apache/servicecomb-pack/pull/607#discussion_r350006803
##########
File path:
omega/omega-connector/omega-connector-grpc/src/main/java/org/apache/servicecomb/pack/omega/connector/grpc/core/ReconnectStreamObserver.java
##########
@@ -42,10 +45,23 @@ public ReconnectStreamObserver(
public void onError(Throwable t) {
LOG.error("Failed to process grpc coordinate command.", t);
loadContext.getGrpcOnErrorHandler().handle(messageSender);
+ cancelWait();
}
@Override
public void onCompleted() {
// Do nothing here
}
+
+ public void cancelWait(){
+ latch.countDown();
+ }
+
+ public void waitConnected() {
Review comment:
> When will you call the waitConnected?
Waiting only happens when Omega first connects to Alpha.
I marked the location where call waitConnected in
GrpcSagaClientMessageSender.java L77
> I don't think it's a good practice to introduce sync wait here.
The original idea was when Alpha receives the connection request, it sends a
response message to Omega. Omega receives the response message and then
continues.
if you don't feel it's needed I would remove them
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services