From bd1a1404762e829ad583ff2d3eeb59ec90d96980 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Wed, 5 Feb 2014 11:13:08 -0800 Subject: [PATCH] consul: Adding a sanity check --- consul/rpc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/consul/rpc.go b/consul/rpc.go index 27df98cef0..ebb86aa26b 100644 --- a/consul/rpc.go +++ b/consul/rpc.go @@ -162,6 +162,11 @@ func (s *Server) blockingRPC(b *structs.BlockingQuery, tables MDBTables, run fun goto RUN_QUERY } + // Sanity check that we have tables to block on + if len(tables) == 0 { + panic("no tables to block on") + } + // Restrict the max query time if b.MaxQueryTime > maxQueryTime { b.MaxQueryTime = maxQueryTime