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

change ordering to allow prestart script to SIGHUP containerpilot #140

Closed
wants to merge 8 commits into from

Conversation

wleese
Copy link

@wleese wleese commented Apr 26, 2016

Due to ordering it is currently not possible to have the preStart script dynamically change containerpilot configuration.

Maybe this change has other consequences I cannot for see, but tests work and a kill -SIGHUP 1 from the preStart script now hits reloadConfig rather than causing containerpilot to exit.

Change-Id: Ic4494e4b31324c91aeb328aef55afa3a42306590
@tgross
Copy link
Contributor

tgross commented Apr 26, 2016

Maybe this change has other consequences I cannot for see

Well in addition to what you're intending to fix, it'll fix a bug that we didn't realize we had -- if the preStart handler created zombies then they wouldn't be reaped because we hadn't set up the SIGCHLD signal handler yet!

The only potential source of trouble is what happens if we receive a SIGUSR1 or SIGTERM during the preStart. In this case we'll end up trying to terminate any polling functions, but they will be nil at that point in time. I think this is going to be ok but can we add a test that exercises that path to be sure?

Change-Id: Ic61469ef140428e0c6cb25331e63bd464ceee6b5
@wleese
Copy link
Author

wleese commented Apr 28, 2016

In this case we'll end up trying to terminate any polling functions, but they will be nil at that point in time.

In the test I'm doing a SIGUSR1 from the prestart script, then using test-probe I send a SIGHUP and see if containerpilot still registers the test service. Lots of assumptions here regarding your comment and how the tests work.

Change-Id: Ib4e732a324af4b775ac380e416bc9f5406059839
Change-Id: I2ea779a0d21de225ef0087ff784b20c3739fb1aa
@tgross
Copy link
Contributor

tgross commented May 2, 2016

This LGTM but a merge conflict popped up once #138 was merged. If we can get that resolved I think this is good-to-go.

Change-Id: Ief5c8c90c2ed7772b4aa6c28268fd6944eca6584
@wleese
Copy link
Author

wleese commented May 2, 2016

Fixed the conflict but haven't tested the new stuff from #138 just yet. Will get to that tomorrow.

wleese added 2 commits May 3, 2016 10:01
Change-Id: I8a711b0065ec278355a1d3c33e7809f62baa8721
Change-Id: I233b3261bace3367a1287a7c917b05eee5a6013b
@wleese
Copy link
Author

wleese commented May 3, 2016

With #138 and attempting a HUP during onstart I get:
2016/05/03 03:02:40 Error initializing config: -config flag is required

Added a new test to check this path.

Change-Id: I0e55417c27f343772313b0d0c2147b2d3cd60975
@wleese
Copy link
Author

wleese commented May 3, 2016

Interesting how a fix for the hup reload() now triggers: FAIL: test_sighup_deadlock

@misterbisson
Copy link
Contributor

@wleese have you had any further insight into this one? Anything we can help with?

@wleese
Copy link
Author

wleese commented May 12, 2016

Priorities have shifted a bit, leaving no time for this PR the coming weeks.

On Thursday, 12 May 2016, Casey Bisson notifications@github.com wrote:

@wleese https://github.com/wleese have you had any further insight into
this one? Anything we can help with?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#140 (comment)

@tgross
Copy link
Contributor

tgross commented May 31, 2016

Closing in lieu of #165

@tgross tgross closed this May 31, 2016
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.

3 participants