main: actor functionality comments

This commit is contained in:
Sneha Inguva 2018-04-01 11:19:30 -07:00
parent 0245fd55bf
commit 7be846754a
1 changed files with 13 additions and 0 deletions

View File

@ -361,6 +361,7 @@ func main() {
var g group.Group var g group.Group
{ {
// Termination handler.
term := make(chan os.Signal) term := make(chan os.Signal)
signal.Notify(term, os.Interrupt, syscall.SIGTERM) signal.Notify(term, os.Interrupt, syscall.SIGTERM)
cancel := make(chan struct{}) cancel := make(chan struct{})
@ -386,6 +387,7 @@ func main() {
) )
} }
{ {
// Scrape discovery manager.
g.Add( g.Add(
func() error { func() error {
err := discoveryManagerScrape.Run() err := discoveryManagerScrape.Run()
@ -399,6 +401,7 @@ func main() {
) )
} }
{ {
// Notify discovery manager.
g.Add( g.Add(
func() error { func() error {
err := discoveryManagerNotify.Run() err := discoveryManagerNotify.Run()
@ -412,6 +415,7 @@ func main() {
) )
} }
{ {
// Scrape manager.
g.Add( g.Add(
func() error { func() error {
// When the scrape manager receives a new targets list // When the scrape manager receives a new targets list
@ -433,6 +437,8 @@ func main() {
) )
} }
{ {
// Reload handler.
// Make sure that sighup handler is registered with a redirect to the channel before the potentially // Make sure that sighup handler is registered with a redirect to the channel before the potentially
// long and synchronous tsdb init. // long and synchronous tsdb init.
hup := make(chan os.Signal) hup := make(chan os.Signal)
@ -467,6 +473,7 @@ func main() {
) )
} }
{ {
// Initial configuration loading.
cancel := make(chan struct{}) cancel := make(chan struct{})
g.Add( g.Add(
func() error { func() error {
@ -496,6 +503,7 @@ func main() {
) )
} }
{ {
// TSDB.
cancel := make(chan struct{}) cancel := make(chan struct{})
g.Add( g.Add(
func() error { func() error {
@ -526,6 +534,7 @@ func main() {
) )
} }
{ {
// Web handler.
g.Add( g.Add(
func() error { func() error {
if err := webHandler.Run(ctxWeb); err != nil { if err := webHandler.Run(ctxWeb); err != nil {
@ -542,6 +551,8 @@ func main() {
) )
} }
{ {
// Rule manager.
// TODO(krasi) refactor ruleManager.Run() to be blocking to avoid using an extra blocking channel. // TODO(krasi) refactor ruleManager.Run() to be blocking to avoid using an extra blocking channel.
cancel := make(chan struct{}) cancel := make(chan struct{})
g.Add( g.Add(
@ -557,6 +568,8 @@ func main() {
) )
} }
{ {
// Notifier.
// Calling notifier.Stop() before ruleManager.Stop() will cause a panic if the ruleManager isn't running, // Calling notifier.Stop() before ruleManager.Stop() will cause a panic if the ruleManager isn't running,
// so keep this interrupt after the ruleManager.Stop(). // so keep this interrupt after the ruleManager.Stop().
g.Add( g.Add(