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

reload db-credentials-file upon SIGHUP #4514

Merged
merged 3 commits into from
Jan 15, 2019
Merged

Conversation

acharis
Copy link
Contributor

@acharis acharis commented Jan 10, 2019

why we want this is a bit of a long story, but reloading creds on receipt of SIGHUP seems like a good idea.

Signed-off-by: Alex Charis acharis@hubspot.com

Signed-off-by: Alex Charis <acharis@hubspot.com>
@acharis acharis requested a review from sougou as a code owner January 10, 2019 19:21
Signed-off-by: Alex Charis <acharis@hubspot.com>
Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits.

sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGHUP)
go func() {
for {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use for _ = range sigChan {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofmt changed that to for range sigChan

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and i made the same change the two other places i saw the bare for

go func() {
for {
<-sigChan
fcs, ok := AllCredentialsServers["file"].(*FileCredentialsServer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline this with if fcs...; ok {

Signed-off-by: Alex Charis <acharis@hubspot.com>
@sougou sougou merged commit c1cd824 into vitessio:master Jan 15, 2019
@acharis acharis deleted the dbconfig-reload branch January 15, 2019 01:16
frouioui pushed a commit to planetscale/vitess that referenced this pull request Mar 26, 2024
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.

2 participants