Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Outscale API backoff #475

Open
jfbus opened this issue Feb 27, 2025 · 0 comments
Open

Cleanup Outscale API backoff #475

jfbus opened this issue Feb 27, 2025 · 0 comments
Milestone

Comments

@jfbus
Copy link
Contributor

jfbus commented Feb 27, 2025

The k8s backoff only backoffs when the backoff function returns false, nil.

The usual backoff from OAPI would be:

  • no backoff on TCP errors,
  • backoff on some HTTP errors (based on status code).

All CAPOSC OAPI calls use backoff the same way:

response, httpRes, err = oscApiClient.ApiCall()
if err != nil {
	if httpRes != nil {
		// does not trigger backoff
		return false, fmt.Errorf("error %w httpRes %s", err, httpRes.Status)
	}
	// httpRes is currently nil, only TCP errors without http response are left
	requestStr := fmt.Sprintf("%v", readImageRequest)
	if reconciler.KeepRetryWithError(
		requestStr,
		httpRes.StatusCode, // triggers a nil pointer exception ...
		reconciler.ThrottlingErrors) {
		// even if there was no nil pointer, will never be called as all http errors have already been handled
		return false, nil
	}
	return false, err
}
return true, err

There are two options:

  • fix backoff
  • remove backoff

As the cluster-api controller does backoff, backoff on CAPOSC side isn't really necessary.

Removing all backoff code would simplify things and would not change the way CAPOSC works.

@jfbus jfbus added this to the v0.5.0 milestone Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant