Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
pack-0.6.0
-
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
- links to