From c46ffe39a894fb0d7ba0ddc5caf2af5b7e779da5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 27 Mar 2017 20:46:46 +0400 Subject: [PATCH] [service] check for error returned by impl otherwise, we mark it as started when it is not in fact --- service.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service.go b/service.go index e2d31925..8cd06472 100644 --- a/service.go +++ b/service.go @@ -94,6 +94,11 @@ func (bs *BaseService) Start() (bool, error) { } } err := bs.impl.OnStart() + if err != nil { + // revert flag + atomic.StoreUint32(&bs.started, 0) + return false, err + } return true, err } else { if bs.log != nil {