Skip to content

Commit 64037cc

Browse files
[ICD]Retrigger subscription immediately when subscription stuck in idle status
1 parent ed1babf commit 64037cc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/app/ReadClient.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,14 @@ void ReadClient::OnActiveModeNotification()
486486
{
487487
// This function just tries to complete the deferred resubscription logic in `OnLivenessTimeoutCallback`.
488488
VerifyOrDie(mpImEngine->InActiveReadClientList(this));
489-
// If we are not in InactiveICDSubscription state, that means the liveness timeout has not been reached. Simply do nothing.
490-
VerifyOrReturn(IsInactiveICDSubscription());
489+
// If we are in InactiveICDSubscription state, it means the liveness timeout has been reached.
490+
// If we are in Idle state, it means subscription stuck in initialized state, and device cannot be reached
491+
// If we are not in the above, simply do nothing.
492+
// If we are in the above, we should trigger immediate resubscription.
493+
VerifyOrReturn(IsInactiveICDSubscription() || IsIdle());
491494

492-
// When we reach here, the subscription definitely exceeded the liveness timeout. Just continue the unfinished resubscription
493-
// logic in `OnLivenessTimeoutCallback`.
495+
mNumRetries = 0;
496+
CancelResubscribeTimer();
494497
TriggerResubscriptionForLivenessTimeout(CHIP_ERROR_TIMEOUT);
495498
}
496499

0 commit comments

Comments
 (0)