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

Stop watching SIGTERM before starting process #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

n1koo
Copy link

@n1koo n1koo commented Oct 26, 2020

Fixes a problem where during start we never close the parent channel that watches for SIGTERM resulting in double signal watchers that collide with each other.

testapp-niko-bar-1603710120-hp998 bar panic: close of closed channel
testapp-niko-bar-1603710120-hp998 bar
testapp-niko-bar-1603710120-hp998 bar goroutine 17 [running]:
testapp-niko-bar-1603710120-hp998 bar main.withCancelOnSignal.func1(0xc0000a5980, 0xc0001ecf90, 0x14b9c40, 0xc00027e680)
testapp-niko-bar-1603710120-hp998 bar 	/build/cmd/kubexit/main.go:223 +0x1c6
testapp-niko-bar-1603710120-hp998 bar created by main.withCancelOnSignal
testapp-niko-bar-1603710120-hp998 bar 	/build/cmd/kubexit/main.go:211 +0xe1

parentCancel() is safe to call (no double cancel) when coming out of pod watching due to the fact we now bail out with os.Exit(0 on line 219 rather than starting the app and skipping watches.

@karlkfi karlkfi closed this Jul 2, 2021
@karlkfi karlkfi reopened this Jul 2, 2021
alessiovolpe referenced this pull request in Musixmatchdev/kubexit May 31, 2022
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

2 participants