You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "Lei Zhang (Jira)" <ji...@apache.org> on 2020/06/16 13:54:00 UTC

[jira] [Assigned] (SCB-2004) When the business service startup is not completed, receiving a compensation request will cause gRPC and alpha to reconnect

     [ https://issues.apache.org/jira/browse/SCB-2004?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lei Zhang reassigned SCB-2004:
------------------------------

    Assignee: Lei Zhang

> When the business service startup is not completed, receiving a compensation request will cause gRPC and alpha to reconnect
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SCB-2004
>                 URL: https://issues.apache.org/jira/browse/SCB-2004
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Saga
>    Affects Versions: pack-0.6.0
>            Reporter: Lei Zhang
>            Assignee: Lei Zhang
>            Priority: Major
>
> If the Alpha's compensation call is received during the business service startup process, compensation failure will occasionally occur
>  
>  Because at startup, it will be connected to Alpha first, and then all compensation methods will be scanned and put to the class CallbackContext, If business service receives a compensation request before CallbackContext initialization, you will get NullPointerExceptionBecause at startup, it will be connected to Alpha first, and then all compensation methods will be scanned and put to the class CallbackContext, If business service receives a compensation request before CallbackContext initialization, you will get NullPointerException
>  
> {code:java}
>   public void apply(String globalTxId, String localTxId, String parentTxId, String callbackMethod, Object... payloads) {
>     CallbackContextInternal contextInternal = contexts.get(callbackMethod); <----- this is empty
>     String oldGlobalTxId = omegaContext.globalTxId();
>     String oldLocalTxId = omegaContext.localTxId();
>     try {
>       omegaContext.setGlobalTxId(globalTxId);
>       omegaContext.setLocalTxId(localTxId);
>       contextInternal.callbackMethod.invoke(contextInternal.target, payloads);
>       if (omegaContext.getAlphaMetas().isAkkaEnabled()) {
>         sender.send(
>             new TxCompensateAckSucceedEvent(omegaContext.globalTxId(), omegaContext.localTxId(),
>                 parentTxId, callbackMethod));
>       }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)