You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have experienced that when the auth token expires in a long running application, the SDK does not retry the failed operation after token refresh. Instead, after refreshing the token, it returns the error from the original failed attempt.
I did some digging and it turns out that the root cause is actually an off-by-one error the vendored version of resty v2.2.0. This bug was fixed in v2.3.0.
The max retries are set in pkg/client/group_mgmt_client.go
// NewClient instantiates a new client to communicate with the Nimble group
func NewClient(ipAddress, username, password, apiVersion string, waitOnJobs, isTenant bool, tlsConfig *tls.Config) (*GroupMgmtClient, error) {
...
// Add a retry condition to perform a relogin if the session has expired
groupMgmtClient.Client.
AddRetryCondition(
...
).SetRetryCount(maxLoginRetries) <<<<-------
...
}
The bug in resty counts the original request as one of the retry attempts, so that a RetryCount of 1 will only make the first request and upon retry it exits because it has exhausted the RetryCount.
The text was updated successfully, but these errors were encountered:
I have experienced that when the auth token expires in a long running application, the SDK does not retry the failed operation after token refresh. Instead, after refreshing the token, it returns the error from the original failed attempt.
I did some digging and it turns out that the root cause is actually an off-by-one error the vendored version of
resty
v2.2.0. This bug was fixed in v2.3.0.The max retries are set in pkg/client/group_mgmt_client.go
and used https://github.com/hpe-storage/nimble-golang-sdk/blob/master/pkg/client/group_mgmt_client.go#L130
The bug in
resty
counts the original request as one of the retry attempts, so that aRetryCount
of 1 will only make the first request and upon retry it exits because it has exhausted the RetryCount.The text was updated successfully, but these errors were encountered: