Skip to content

Commit

Permalink
fix a case where we would fail fetching the second time
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlavanet committed Apr 8, 2024
1 parent eb491ce commit 47e1273
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion protocol/lavasession/consumer_session_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,16 @@ func (csm *ConsumerSessionManager) GetSessions(ctx context.Context, cuNeededForS

// If error happens, and we do not have any sessions return error
if err != nil {
return nil, err
if PairingListEmptyError.Is(err) {
// got no pairing available, try to recover a session from the currently banned providers
var errOnRetry error
sessionWithProviderMap, errOnRetry = csm.tryGetConsumerSessionWithProviderFromBlockedProviderList(tempIgnoredProviders, cuNeededForSession, requestedBlock, addon, extensionNames, stateful, virtualEpoch, usedProviders)
if errOnRetry != nil {
return nil, err // return original error (getValidConsumerSessionsWithProvider)
}
} else {
return nil, err
}
}
}
}
Expand Down

0 comments on commit 47e1273

Please sign in to comment.