345
// It can't be nil due to removing versions, as that would result in a non-nil container with
346
// nil inner fields.
348
m.setUserDataForNonOwningPartition(res.GetUserData())
349
userDataVersionChanged = res.GetUserData().GetVersion() != knownUserData.GetVersion()
350
m.logNewUserData("fetched user data from parent", res.GetUserData())
352
m.logger.Debug("fetched user data from parent, no change")
353
}
355
m.gotIncomingEphemeralData(res.EphemeralData)
356
}
358
>
m.setUserDataState(userDataEnabled, nil)
359
>
return nil
360
}
361
363
>
minWaitTime := m.config.GetUserDataMinWaitTime
364
>
365
>
for ctx.Err() == nil {
366
>
start := time.Now()
367
>
_ = backoff.ThrottleRetryContext(ctx, op, m.config.GetUserDataRetryPolicy, nil)
368
>
elapsed := time.Since(start)
369
>
370
>
// In general, we want to start a new call immediately on completion of the previous
371
>
// one. But if the remote is broken and returns success immediately, we might end up
372
>
// spinning. So enforce a minimum wait time that increases as long as we keep getting
373
>
// very fast replies.
374
>
// If the user data version changed it means new data was received so we skip this check.
375
>
if !userDataVersionChanged && elapsed < m.config.GetUserDataMinWaitTime {
376
if fastResponseCounter >= maxFastUserDataFetches {
377
// maxFastUserDataFetches or more consecutive fast responses, let's throttle!