code: func retryUntilReady(ctx context.Context, timeout time.Duration, cb func(context.Context) error) error {
  	ctx, cancel := clock.WithTimeout(ctx, timeout)
  	defer cancel()
  
  	for {
  		select {
  		case <-ctx.Done():
  			return ErrProcessingTimeout
  		default:
  		}
  
  		switch err := cb(ctx); {
  		case err == nil:
  			return nil
  		case err == context.DeadlineExceeded:
  			continue // this may be short RPC deadline, try again
  		case grpc.Code(err) == codes.FailedPrecondition: // the instance is not ready
  			logging.Warningf(ctx, "cipd: %s", humanErr(err))
  			if clock.Sleep(clock.Tag(ctx, "cipd-sleeping"), retryDelay).Incomplete() {
  				return ErrProcessingTimeout
  			}
  		default:
  			return humanErr(err)
  		}
  	}
  }
docs: // retryUntilReady calls the callback and retries on FailedPrecondition errors,
  // which indicate that the instance is not ready yet (still being processed by
  // the backend).