-
Notifications
You must be signed in to change notification settings - Fork 163
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
Use fatal library in path_srv, cert_srv and sciond #2208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r2.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @sustrik)
go/godispatcher/main.go, line 61 at r2 (raw file):
<-fatal.Chan() // Prometheus encountered a fatal error, thus we exit. log.Crit("Unable to listen and serve")
Those two lines above are no longer needed.
go/lib/fatal/fatal.go, line 15 at r2 (raw file):
provide
provides
go/lib/fatal/fatal.go, line 19 at r2 (raw file):
they
not needed
go/lib/fatal/fatal.go, line 59 at r2 (raw file):
// Ask main goroutine to shut down the application. select { case fatalC <- struct{}{}:
TIL that works a on a nil channel.
go/lib/fatal/fatal.go, line 62 at r2 (raw file):
// Block until the application shuts down. select {} case <-time.After(10 * time.Second):
10 is plenty, maybe use 5 or 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @lukedirtwalker)
go/godispatcher/main.go, line 61 at r2 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
Those two lines above are no longer needed.
Done.
go/lib/fatal/fatal.go, line 15 at r2 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
provide
provides
Done.
go/lib/fatal/fatal.go, line 19 at r2 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
they
not needed
Done.
go/lib/fatal/fatal.go, line 62 at r2 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
10 is plenty, maybe use 5 or 2?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3.
Reviewable status:complete! all files reviewed, all discussions resolved
This patch also moves logging the fatal condition into the failing
goroutine and makes servers wait for 1 second before exiting. This
way we can collect multiple fatal errors in the log in case the
first one is not the most informative one.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)