This repository was archived by the owner on Aug 31, 2022. It is now read-only.
[telemetry] Reload telemetry server configuration.#92
Open
[telemetry] Reload telemetry server configuration.#92
Conversation
…ing the `SIGHUP` signal. Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
5 tasks
Contributor
Author
|
@zbud-msft Can you please help me review this PR? |
zbud-msft
reviewed
May 31, 2022
| // updated certificate and key files. | ||
| func SignalHandler(server *gnmi.Server, signalChannel <-chan os.Signal) { | ||
| signalReceiver := <-signalChannel | ||
| log.V(1).Infof("gRPC server receives signal: %s and will be stopped!", signalReceiver) |
Contributor
There was a problem hiding this comment.
We should check that the signal received from channel is sighup before stopping server in case we want to reuse signal handler
qiluo-msft
reviewed
Jun 11, 2022
| // SignalHandler will block and wait for the signal `SIGHUP`. Once it receives signal, | ||
| // the gRPC server will be stopped and new gRPC server instance will be created with | ||
| // updated certificate and key files. | ||
| func SignalHandler(server *gnmi.Server, signalChannel <-chan os.Signal) { |
Contributor
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Signed-off-by: Yong Zhao yozhao@microsoft.com
Why I did it
We want to reload the configuration of telemetry server if the certificate and key files are rotated. This PR is related to: [telemetry] Rotate streaming telemetry secrets. sonic-buildimage#9600.
How I did it
I created a signal hander which will stop current gRPC server and then create a new one with updated credentials if signal
SIGHUPwas received.How to verify it
I did this implementation and tested them on a virtual switch.