Uploaded image for project: 'Apache ServiceComb'
  1. Apache ServiceComb
  2. SCB-2004

When the business service startup is not completed, receiving a compensation request will cause gRPC and alpha to reconnect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • pack-0.6.0
    • pack-0.6.0
    • Saga
    • None

    Description

      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

       

        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));
            }
      

       

      Attachments

        Issue Links

          Activity

            People

              zhanglei Lei Zhang
              zhanglei Lei Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: