From 1f3570536f5d54f8f1205031f067b0fa1d59becc Mon Sep 17 00:00:00 2001 From: John Shahid Date: Wed, 5 Nov 2014 16:46:03 -0500 Subject: [PATCH] Don't try to close the protobuf server if it's not open Fix #584 --- CHANGELOG.md | 2 ++ coordinator/protobuf_server.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f0b82c13a..eaa19958763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ### Bugfixes +- [Issue #584](https://github.com/influxdb/influxdb/issues/584). Don't + panic if the process died while initializing - [Issue #800](https://github.com/influxdb/influxdb/issues/800). Use su instead of sudo in the init script. This fixes the startup problem on RHEL 6. diff --git a/coordinator/protobuf_server.go b/coordinator/protobuf_server.go index f4ff0720dad..e49abac9147 100644 --- a/coordinator/protobuf_server.go +++ b/coordinator/protobuf_server.go @@ -31,6 +31,10 @@ func NewProtobufServer(port string, requestHandler Handler) *ProtobufServer { } func (self *ProtobufServer) Close() { + if self.listener == nil { + return + } + self.listener.Close() self.connectionMapLock.Lock() defer self.connectionMapLock.Unlock()