Repository navigation
fix(tls): install the SIGHUP handler before the listener is announced - #489
Merged
Merged
Conversation
The TLS reload task registered its SIGHUP handler and took the files' fingerprint on its first poll, after `listening on` was printed. A SIGHUP sent in between was lost (CI, where the runner ignores SIGHUP) or ended the process (the default action), and `files_that_do_not_load_leave_the_ previous_configuration` failed now and then. `tls::reload` now sets both up when called, and serve calls it before announcing the listener. a_sighup_before_the_first_poll_reloads raises SIGHUP between the call and the first poll; with the setup moved back into the future the test process dies of SIGHUP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
listener_tls.rs'sfiles_that_do_not_load_leave_the_previous_configurationfailed once on CI (#485's run): the gateway never logged the reload failure the test waits for after its SIGHUP.Cause.
tls::reloadregistered its SIGHUP handler and took the files' fingerprint on its first poll, and serve spawned it after printinglistening on. The test sends SIGHUP as soon as that line appears, so the signal could arrive before the handler existed. On CI the runner ignores SIGHUP, so the signal was dropped; elsewhere the default action ends the process, so a SIGHUP right after startup stopped the gateway.Fix.
tls::reloadsets up the handler and the fingerprint when it is called and returns the watch loop as a future.servecalls it right after building the TLS configuration, before the listener is announced.Test.
a_sighup_before_the_first_poll_reloads(unit, Unix) callsreload, sends SIGHUP to the test process before the future first runs, then polls it and expects the configuration to be replaced. With the setup moved back into the future, the test process dies of SIGHUP.Ran locally:
tls::tests(4) andlistener_tls(7).