Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1804 from bloomberg/fix_plan_pool
Browse files Browse the repository at this point in the history
Use pointers so plan.Clean() works
  • Loading branch information
Dieterbe authored Apr 27, 2020
2 parents 1515234 + abebe09 commit 75884f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/graphite.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (s *Server) renderMetrics(ctx *middleware.Context, request models.GraphiteR

execCtx, execSpan := tracing.NewSpan(ctx.Req.Context(), s.Tracer, "executePlan")
defer execSpan.Finish()
out, meta, err := s.executePlan(execCtx, ctx.OrgId, plan)
out, meta, err := s.executePlan(execCtx, ctx.OrgId, &plan)
if err != nil {
err := response.WrapError(err)
if err.HTTPStatusCode() == http.StatusBadRequest && !request.NoProxy && proxyBadRequests {
Expand Down Expand Up @@ -687,7 +687,7 @@ func (s *Server) metricsDeleteRemote(ctx context.Context, orgId uint32, query st
// executePlan looks up the needed data, retrieves it, and then invokes the processing
// note if you do something like sum(foo.*) and all of those metrics happen to be on another node,
// we will collect all the individual series from the peer, and then sum here. that could be optimized
func (s *Server) executePlan(ctx context.Context, orgId uint32, plan expr.Plan) ([]models.Series, models.RenderMeta, error) {
func (s *Server) executePlan(ctx context.Context, orgId uint32, plan *expr.Plan) ([]models.Series, models.RenderMeta, error) {
var meta models.RenderMeta

minFrom := uint32(math.MaxUint32)
Expand Down
2 changes: 1 addition & 1 deletion expr/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func newplanFunc(e *expr, fn GraphiteFunc, context Context, stable bool, reqs []
}

// Run invokes all processing as specified in the plan (expressions, from/to) against the given datamap
func (p Plan) Run(dataMap DataMap) ([]models.Series, error) {
func (p *Plan) Run(dataMap DataMap) ([]models.Series, error) {
var out []models.Series
p.dataMap = dataMap
for _, fn := range p.funcs {
Expand Down

0 comments on commit 75884f2

Please sign in to comment.