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

Retry creation REST calls that fail #262

Merged
merged 2 commits into from
Nov 6, 2018
Merged

Retry creation REST calls that fail #262

merged 2 commits into from
Nov 6, 2018

Conversation

hausdorff
Copy link
Contributor

This commit will introduce a simple retry mechanism that makes the
Kubernetes provider more tolerant to misordered resource creation, as is
particularly common in Helm and Kubernetes YAML. For example, if
Kubernetes YAML specifies to create a Pod before the Namespace it
resides in, it is likely this will cause pulumi up to fail. Another
example is creating CustomResoruces before an operator or controller has
the opportunity to register the relevant CustomResourceDefinitions.

We ameliorate this bug by retrying creation REST calls that fail, with
some backoff, and some maximum retry threshold. The effects of this are:

  • Makes the Kubernetes provider somewhat tolerant to undeclared
    dependencies between resources.
  • Makes the Kubernetes provider somewhat tolerant to under-specified
    CRDs, custom controllers, and custom operators, since the retry logic
    can stand in for all but the most complex of these (which would still
    require await logic).

This commmit represents major progress towards #240, and should (we
believe) fix #239.

@hausdorff hausdorff added this to the 0.19 milestone Nov 5, 2018
@lukehoban
Copy link
Member

Don you have a link to similar logic in kubectl we could reference as baseline for the strategy and chosen constants here? Would be nice to include in code comments as well.

Copy link
Contributor

@swgillespie swgillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tests/integration/retry/step1/package.json Outdated Show resolved Hide resolved
@hausdorff hausdorff force-pushed the hausdorff/retry branch 2 times, most recently from 4f6b393 to e8b6804 Compare November 6, 2018 05:04
This commit will introduce a simple retry mechanism that makes the
Kubernetes provider more tolerant to misordered resource creation, as is
particularly common in Helm and Kubernetes YAML. For example, if
Kubernetes YAML specifies to create a `Pod` before the `Namespace` it
resides in, it is likely this will cause `pulumi up` to fail. Another
example is creating `CustomResoruces` before an operator or controller has
the opportunity to register the relevant `CustomResourceDefinition`s.

We ameliorate this bug by retrying creation REST calls that fail, with
some backoff, and some maximum retry threshold. The effects of this are:

* Makes the Kubernetes provider somewhat tolerant to undeclared
  dependencies between resources.
* Makes the Kubernetes provider somewhat tolerant to under-specified
  CRDs, custom controllers, and custom operators, since the retry logic
  can stand in for all but the most complex of these (which would still
  require await logic).

This commmit represents major progress towards #240, and should (we
believe) fix #239.
@hausdorff hausdorff merged commit d54c5fd into master Nov 6, 2018
@pulumi-bot pulumi-bot deleted the hausdorff/retry branch November 6, 2018 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm: resource ordering not working
3 participants