Skip to content

Commit

Permalink
Fix retry count to indicate count only after a retry has occured
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 committed Dec 8, 2021
1 parent cc8fc05 commit e5998f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/source/Signaling/StateMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,7 @@ STATUS defaultSignalingStateTransitionHook(
CHK(pSignalingClient->result > SERVICE_CALL_RESULT_OK &&
pSignalingStateMachineRetryStrategyCallbacks->executeRetryStrategyFn != NULL, STATUS_SUCCESS);

DLOGV("Signaling Client base result is [%u]. Executing KVS retry handler of retry strategy type [%u]",
pSignalingClient->result, pSignalingStateMachineRetryStrategy->retryStrategyType);
pSignalingStateMachineRetryStrategyCallbacks->executeRetryStrategyFn(pSignalingStateMachineRetryStrategy, &retryWaitTime);
*stateTransitionWaitTime = retryWaitTime;

// A retry is considered only after executeRetry is executed. This will avoid publishing count + 1
if(pSignalingStateMachineRetryStrategyCallbacks->getCurrentRetryAttemptNumberFn != NULL) {
if((countStatus = pSignalingStateMachineRetryStrategyCallbacks->getCurrentRetryAttemptNumberFn(pSignalingStateMachineRetryStrategy, &pSignalingClient->diagnostics.stateMachineRetryCount)) != STATUS_SUCCESS) {
DLOGW("Failed to get retry count. Error code: %08x", countStatus);
Expand All @@ -160,6 +156,10 @@ STATUS defaultSignalingStateTransitionHook(
DLOGD("Retry count: %llu", pSignalingClient->diagnostics.stateMachineRetryCount);
}
}
DLOGV("Signaling Client base result is [%u]. Executing KVS retry handler of retry strategy type [%u]",
pSignalingClient->result, pSignalingStateMachineRetryStrategy->retryStrategyType);
pSignalingStateMachineRetryStrategyCallbacks->executeRetryStrategyFn(pSignalingStateMachineRetryStrategy, &retryWaitTime);
*stateTransitionWaitTime = retryWaitTime;

CleanUp:

Expand Down

0 comments on commit e5998f2

Please sign in to comment.