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

Use Cmd.WaitDelay and Cmd.Cancel with CommandContext to simplify captive core termination #5347

Closed
tamirms opened this issue Jun 14, 2024 · 0 comments

Comments

@tamirms
Copy link
Contributor

tamirms commented Jun 14, 2024

In #3694 we introduced the following code which attempts to gracefully terminate captive core:

https://github.com/bartekn/go/blob/36251ee7536bd423a66803c0ead9825ccefd084d/ingest/ledgerbackend/stellar_core_runner.go#L357-L404

This code was taken from https://github.com/golang/go/blob/cacac8bdc5c93e7bc71df71981fdf32dded017bf/src/cmd/go/script_test.go#L1091-L1098 .

However, the Go 1.20 release added WaitDelay and Cancel properties to Cmd. These new features along with https://pkg.go.dev/os/exec#CommandContext can be used to simplify the termination logic for captive core (see golang/go@49abdbc for an example of how to use WaitDelay / Cancel).

@tamirms tamirms changed the title Use Cmd.WaitDelay and Cmd.Cancel to simplify captive core termination Use Cmd.WaitDelay and Cmd.Cancel with CommandContext to simplify captive core termination Jun 16, 2024
@tamirms tamirms moved this from Backlog to In Progress in Platform Scrum Jun 26, 2024
@tamirms tamirms added this to the platform sprint 48 milestone Jun 26, 2024
@tamirms tamirms self-assigned this Jun 26, 2024
@tamirms tamirms moved this from In Progress to Needs Review in Platform Scrum Jun 26, 2024
@tamirms tamirms closed this as completed Jun 28, 2024
@github-project-automation github-project-automation bot moved this from Needs Review to Done in Platform Scrum Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants
@tamirms and others