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

Implement ResourceProviderServer#Cancel #94

Merged
merged 1 commit into from
Jul 18, 2018
Merged

Conversation

hausdorff
Copy link
Contributor

@hausdorff hausdorff commented Jul 18, 2018

This commit will implement Cancel, the new function exposed on the
gRPC resource provider server interface introduced in
pulumi/pulumi#1633.

The semantics of Cancel are to issue a non-blocking, advisory
cancellation signal to all resource operations in progress.

In practice, since the Kubernetes Go client does not take a cancellation
context to cancel resource operations that are currently in flight, in
the case of the Kubernetes resource provider, we will typically cancel
as we are waiting for the resource operation (e.g., initialization) to
complete. In other words, the HTTP request we use to signal resource
creation to the Kubernetes API server will never be cancelled in flight;
if the resource is complex enough to require initialization, we'll
cancel at the nearest opportunity.

This commit will implement `Cancel`, the new function exposed on the
gRPC resource provider server interface introduced in
pulumi/pulumi #1633.

The semantics of `Cancel` are to issue a non-blocking, advisory
cancellation signal to all resource operations in progress.

In practice, since the Kubernetes Go client does not take a cancellation
context to cancel resource operations that are currently in flight, in
the case of the Kubernetes resource provider, we will typically cancel
as we are waiting for the resource operation (e.g., initialization) to
complete. In other words, the HTTP request we use to signal resource
creation to the Kubernetes API server will never be cancelled in flight;
if the resource is complex enough to require initialization, we'll
cancel at the nearest opportunity.

Fixes #89.
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, looks idiomatic to me. Shame that the k8s go client doesn't let you pass Contexts...

@hausdorff hausdorff merged commit 8c0b67e into master Jul 18, 2018
@pulumi-bot pulumi-bot deleted the hausdorff/sigint branch July 18, 2018 19: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.

2 participants