From 72eeacaed4d8702f344d9ae471e351d9f251acd8 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Wed, 21 Jun 2017 09:28:59 -0600 Subject: [PATCH] Append subscribers service after it's open The Points channel is nil until after the subscriber service is opened. If it is append before it's opened, the PointsWriter holds onto the old reference. --- cmd/influxd/run/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/influxd/run/server.go b/cmd/influxd/run/server.go index 11d5556af2..dda2b85e47 100644 --- a/cmd/influxd/run/server.go +++ b/cmd/influxd/run/server.go @@ -177,7 +177,6 @@ func NewServer(c *Config, buildInfo *BuildInfo) (*Server, error) { s.PointsWriter = coordinator.NewPointsWriter() s.PointsWriter.WriteTimeout = time.Duration(c.Coordinator.WriteTimeout) s.PointsWriter.TSDBStore = s.TSDBStore - s.PointsWriter.AddWriteSubscriber(s.Subscriber.Points()) // Initialize query executor. s.QueryExecutor = influxql.NewQueryExecutor() @@ -422,6 +421,8 @@ func (s *Server) Open() error { return fmt.Errorf("open points writer: %s", err) } + s.PointsWriter.AddWriteSubscriber(s.Subscriber.Points()) + for _, service := range s.Services { if err := service.Open(); err != nil { return fmt.Errorf("open service: %s", err)