diff --git a/consul/internal_endpoint.go b/consul/internal_endpoint.go index 939887a8c4..2ec0f6111a 100644 --- a/consul/internal_endpoint.go +++ b/consul/internal_endpoint.go @@ -22,12 +22,18 @@ func (m *Internal) NodeInfo(args *structs.NodeSpecificRequest, } // Get the node info - state := m.srv.fsm.State() - return m.srv.blockingRPC(&args.QueryOptions, + state := m.srv.fsm.StateNew() + return m.srv.blockingRPCNew( + &args.QueryOptions, &reply.QueryMeta, - state.QueryTables("NodeInfo"), + state.GetQueryWatch("NodeInfo"), func() error { - reply.Index, reply.Dump = state.NodeInfo(args.Node) + index, dump, err := state.NodeInfo(args.Node) + if err != nil { + return err + } + + reply.Index, reply.Dump = index, dump return m.srv.filterACL(args.Token, reply) }) } @@ -40,12 +46,18 @@ func (m *Internal) NodeDump(args *structs.DCSpecificRequest, } // Get all the node info - state := m.srv.fsm.State() - return m.srv.blockingRPC(&args.QueryOptions, + state := m.srv.fsm.StateNew() + return m.srv.blockingRPCNew( + &args.QueryOptions, &reply.QueryMeta, - state.QueryTables("NodeDump"), + state.GetQueryWatch("NodeDump"), func() error { - reply.Index, reply.Dump = state.NodeDump() + index, dump, err := state.NodeDump() + if err != nil { + return err + } + + reply.Index, reply.Dump = index, dump return m.srv.filterACL(args.Token, reply) }) }