Skip to content

reload db-credentials-file upon SIGHUP#4514

Merged
sougou merged 3 commits intovitessio:masterfrom
HubSpot:dbconfig-reload
Jan 15, 2019
Merged

reload db-credentials-file upon SIGHUP#4514
sougou merged 3 commits intovitessio:masterfrom
HubSpot:dbconfig-reload

Conversation

@acharis
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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