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

connect: exit if --execute finishes #278

Merged
merged 2 commits into from
May 25, 2021
Merged

connect: exit if --execute finishes #278

merged 2 commits into from
May 25, 2021

Conversation

fatih
Copy link
Member

@fatih fatih commented May 25, 2021

This PR changes the behavior of the --execute flag.

Previously we would continue to serve the proxy even if the command with --execute would finish or fail. With this PR, we're changing it. Instead of silently continuing to run, we're exiting entirely and shutting down the proxy. This is the correct behavior because the user explicitly has passed the --execute flag, and we should assume they only want to run the proxy for a single command.

If there are use cases where we don't want to exit, it's also easy to add it now. We could introduce a new flag that changes whether to call cancel() or not.

This PR changes the behaviour of the `--execute` flag.

Previously we would continue to serve the proxy even if the command with `--execute` would finish or fail. With this PR we're changing it.  Instead of silently continuing to run, we're exiting completely and shutting down the proxy. I believe this is the correct behaviour given the fact that the user explicitly has passed the `--execute` flag.
@fatih fatih requested a review from a team as a code owner May 25, 2021 11:13
ch.Printer.Println("running command with --execute has failed: %s", err)
}

// TODO(fatih): is it worth to making cancellation configurable?
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think so.

@fatih fatih merged commit 20c1f3a into main May 25, 2021
@fatih fatih deleted the fatih-exit-by-default branch May 25, 2021 15:18
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.

None yet

3 participants