From b858b1128636f48f1bd57f44106e34ae626d9d30 Mon Sep 17 00:00:00 2001 From: "liang@qiniu.com" Date: Mon, 30 Nov 2015 10:39:04 +0800 Subject: [PATCH] fix network closed error when show measurements --- tsdb/show_measurements.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsdb/show_measurements.go b/tsdb/show_measurements.go index 2ca88393bc..2db688dc92 100644 --- a/tsdb/show_measurements.go +++ b/tsdb/show_measurements.go @@ -28,13 +28,13 @@ func NewShowMeasurementsExecutor(stmt *influxql.ShowMeasurementsStatement, mappe // Execute begins execution of the query and returns a channel to receive rows. func (e *ShowMeasurementsExecutor) Execute(closing <-chan struct{}) <-chan *models.Row { - // It's important that all resources are released when execution completes. - e.close() - // Create output channel and stream data in a separate goroutine. out := make(chan *models.Row, 0) go func() { + // It's important that all resources are released when execution completes. + defer e.close() + // Open the mappers. for _, m := range e.mappers { if err := m.Open(); err != nil {