From 2e9686c054241b4643ba9e8a91b8ab9b39b63f20 Mon Sep 17 00:00:00 2001 From: Wei Fu Date: Wed, 15 Nov 2023 18:35:26 +0800 Subject: [PATCH] fix: deflake TestCRIImagePullTimeout/HoldingContentOpenWriter The new active request is filed and there is no bytes read yet when the progress reporter just wakes up. If the timeout / 2 is less than the minPullProgressReportInternal, it's easy to file false alert. We should remove the minPullProgressReportInternal limit. Fixes: #8024 Signed-off-by: Wei Fu --- pkg/cri/server/images/image_pull.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkg/cri/server/images/image_pull.go b/pkg/cri/server/images/image_pull.go index cb9db2738..840015052 100644 --- a/pkg/cri/server/images/image_pull.go +++ b/pkg/cri/server/images/image_pull.go @@ -555,9 +555,6 @@ func newTransport() *http.Transport { //} const ( - // minPullProgressReportInternal is used to prevent the reporter from - // eating more CPU resources - minPullProgressReportInternal = 5 * time.Second // defaultPullProgressReportInterval represents that how often the // reporter checks that pull progress. defaultPullProgressReportInterval = 10 * time.Second @@ -605,10 +602,6 @@ func (reporter *pullProgressReporter) start(ctx context.Context) { // check progress more frequently if timeout < default internal if reporter.timeout < reportInterval { reportInterval = reporter.timeout / 2 - - if reportInterval < minPullProgressReportInternal { - reportInterval = minPullProgressReportInternal - } } var ticker = time.NewTicker(reportInterval)