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

remove process cancelling goroutine #190

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

joshrwolf
Copy link
Contributor

the goroutine is redundant, and blocks the actual return of the function when the ctx is done.

Error: -19T14:46:26.742Z [ERROR] provider.terraform-provider-oci_v0.0.17: failed to kill process: @caller=github.com/chainguard-dev/terraform-provider-oci/internal/provider/exec_test_data_source.go:194 error="os: process already finished" tf_data_source_type=oci_exec_test tf_provider_addr=registry.terraform.io/chainguard-dev/oci tf_req_id=c0da7202-2dff-f56f-aebc-de6d70d42686 @module=oci tf_rpc=ReadDataSource timestamp=2024-12-19T14:46:26.741Z

by removing it, we remove the duplicate cancellation handling (the timeout is already plumbed through the context), and the done signal is already handled by exec.CommandContext.

additionally, the process.Kill() is already handled by exec.CommandContext: https://cs.opensource.google/go/go/+/master:src/os/exec/exec.go;l=485

@joshrwolf joshrwolf merged commit 92776a7 into chainguard-dev:main Dec 19, 2024
12 checks passed
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