Skip to content

Commit

Permalink
Merge pull request #9745 from hashicorp/dnephin/fix-streaming-bugs
Browse files Browse the repository at this point in the history
streaming: fix a couple bugs
  • Loading branch information
dnephin authored and hashicorp-ci committed Feb 9, 2021
1 parent 1b01d6f commit 137374a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent/cache-types/streaming_health_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type StreamingHealthServices struct {
// so using a shorter TTL ensures the cache entry expires sooner.
func (c *StreamingHealthServices) RegisterOptions() cache.RegisterOptions {
opts := c.RegisterOptionsBlockingRefresh.RegisterOptions()
opts.LastGetTTL = 10 * time.Minute
opts.LastGetTTL = 20 * time.Minute
return opts
}

Expand Down
5 changes: 4 additions & 1 deletion agent/health_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ func (s *HTTPHandlers) healthServiceNodes(resp http.ResponseWriter, req *http.Re
return nil, nil
}

useStreaming := s.agent.config.UseStreamingBackend && args.MinQueryIndex > 0
// useStreaming when a blocking query is requested, but not when the near
// query parameter is set, because that requires data only available to the server
// to sort the results.
useStreaming := s.agent.config.UseStreamingBackend && args.MinQueryIndex > 0 && args.Source.Node == ""
args.QueryOptions.UseCache = s.agent.config.HTTPUseCache && (args.QueryOptions.UseCache || useStreaming)

out, md, err := s.agent.rpcClientHealth.ServiceNodes(req.Context(), args)
Expand Down
1 change: 0 additions & 1 deletion agent/submatview/materializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ func (m *Materializer) reset() {

m.view.Reset()
m.index = 0
m.retryWaiter.Reset()
}

func (m *Materializer) updateView(events []*pbsubscribe.Event, index uint64) error {
Expand Down

0 comments on commit 137374a

Please sign in to comment.