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

Should quit all processes in "apiserver-boot run local" when one of them failed. #253

Closed
interma opened this issue Jul 19, 2018 · 6 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@interma
Copy link
Contributor

interma commented Jul 19, 2018

Problem:
Now if one process (etcd/apiserver/controller-manager) failed in apiserver-boot run local, other processes don't quit.
Then the following apiserver-boot run local will fail due to the existed processes.

e.g.

$ ./bin/apiserver-boot run local --generate=false
2018/07/19 12:57:03 CGO_ENABLED=0
go build -o bin/apiserver cmd/apiserver/main.go
go build -o bin/controller-manager cmd/controller-manager/main.go
etcd
bin/apiserver --etcd-servers=http://localhost:2379 --secure-port=9443 --delegated-auth=false
W0719 12:58:06.387862   83267 authorization.go:34] Authorization is disabled
W0719 12:58:06.387969   83267 authentication.go:56] Authentication is disabled
I0719 12:58:06.426003   83267 serve.go:89] Serving securely on [::]:9443
bin/controller-manager --kubeconfig=kubeconfig
to test the server run `kubectl --kubeconfig kubeconfig api-versions`
2018-07-19 12:58:08.179764 I | my controller is running
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x175fe7b]
...

# it's my code bug
# fixed code bug and run local again

$ ./bin/apiserver-boot run local --generate=false
2018/07/19 13:00:50 CGO_ENABLED=0
go build -o bin/apiserver cmd/apiserver/main.go
go build -o bin/controller-manager cmd/controller-manager/main.go
etcd
2018/07/19 13:01:48 Failed to run etcd exit status 1

Proposed Solution:
When failure happened, I think quit all processes is better. So users no needed to find and kill the existed processes manually.

Others:
Do you consider this as an improvement or bug fix? If so, I am very glad to open a PR to fix it.
Thanks.

@ghost
Copy link

ghost commented Jul 19, 2018

This piece of code is quite fragile, yes. It doesn't handle interrupts well either and might leave processes running.

So +1 for improving that part.

@interma
Copy link
Contributor Author

interma commented Jul 20, 2018

@damongant thanks for your reply.
My PR is here:
#255

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 24, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 24, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

3 participants