From 4dc645bb8a13d7d76579ce477711a1266e4a2552 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Mon, 29 Feb 2016 13:51:10 -0800 Subject: [PATCH] Add missing 'defer' as it stands now the lock at this spot in the code is pretty useless. All it does it block us but since we release the lock before we check e.state its a roadblock with no real purpose. One could argue that a lock isn't needed at all but I think having it there for consistency with the other funcs would be good. Signed-off-by: Doug Davis --- cluster/engine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/engine.go b/cluster/engine.go index 891d641bbd..e04f6f7080 100644 --- a/cluster/engine.go +++ b/cluster/engine.go @@ -231,7 +231,7 @@ func (e *Engine) isConnected() bool { // IsHealthy returns true if the engine is healthy func (e *Engine) IsHealthy() bool { e.RLock() - e.RUnlock() + defer e.RUnlock() return e.state == stateHealthy }