From 519930a61bbc353a8264a6c0d95ea381cf5cbc9f Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Wed, 27 Apr 2022 05:54:31 -0700 Subject: [PATCH] Replace the only parentCtx with appCtx If this doesn't cause the memory increase then the retention is in `sl.ctx` Signed-off-by: Goutham Veeramachaneni --- scrape/scrape.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrape/scrape.go b/scrape/scrape.go index 76739b9cb2..8efa431f0c 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -1288,7 +1288,7 @@ func (sl *scrapeLoop) scrapeAndReport(last, appendTime time.Time, errc chan<- er } var contentType string - scrapeCtx, cancel := context.WithTimeout(sl.parentCtx, sl.timeout) + scrapeCtx, cancel := context.WithTimeout(sl.appCtx, sl.timeout) contentType, scrapeErr = sl.scraper.scrape(scrapeCtx, buf) cancel()