[ https://issues.apache.org/jira/browse/SCB-227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16326233#comment-16326233 ]
ASF GitHub Bot commented on SCB-227: ------------------------------------ seanyinx commented on a change in pull request #114: SCB-227 stop sub tx from running when global tx failed URL: https://github.com/apache/incubator-servicecomb-saga/pull/114#discussion_r161516481 ########## File path: omega/omega-connector/omega-connector-grpc/src/test/java/org/apache/servicecomb/saga/omega/connector/grpc/LoadBalancedClusterMessageSenderTest.java ########## @@ -293,6 +295,28 @@ public void stopSendingWhenClusterIsDown() throws Exception { await().atMost(2, SECONDS).until(() -> eventsMap.get(8080).size() == 1 || eventsMap.get(8090).size() == 1); } + @Test + public void forwardSendResult() { + assertThat(messageSender.send(event).aborted(), is(false)); + + TxEvent rejectEvent = new TxStartedEvent(globalTxId, localTxId, parentTxId, "reject", "blah"); + assertThat(messageSender.send(rejectEvent).aborted(), is(true)); + } + + @Test + public void blowsUpWhenServerIsInterrupted() { + Thread thread = new Thread(() -> { + try { + messageSender.send(event); + expectFailing(OmegaException.class); + } catch (OmegaException e) { + assertThat(e.getMessage().endsWith("interruption"), is(true)); + } + }); + thread.start(); + thread.interrupt(); Review comment: need to join here to wait for thread exit ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > [pack] stop sub transaction from running when global tx failed > -------------------------------------------------------------- > > Key: SCB-227 > URL: https://issues.apache.org/jira/browse/SCB-227 > Project: Apache ServiceComb > Issue Type: New Feature > Components: Saga > Reporter: Yin Xiang > Assignee: Eric Lee > Priority: Major > > sub transactions may be started in parallel among multiple services. > if one of them failed, none of them shall start at all, if not already > started. -- This message was sent by Atlassian JIRA (v7.6.3#76005)