From 86690730776d3e0120db8b331151afa67a9b7c2b Mon Sep 17 00:00:00 2001 From: kthatipally <99229993+kthatipally@users.noreply.github.com> Date: Thu, 30 Jan 2025 11:53:31 -0600 Subject: [PATCH] Incorporate PR feedback: Add limit to errorgroup Signed-off-by: kthatipally <99229993+kthatipally@users.noreply.github.com> --- provider/internal/builtin/service_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provider/internal/builtin/service_client.go b/provider/internal/builtin/service_client.go index 6ffdc4c0..c5bebf72 100644 --- a/provider/internal/builtin/service_client.go +++ b/provider/internal/builtin/service_client.go @@ -484,6 +484,10 @@ func parallelWalk(location string, regex *regexp2.Regexp) ([]walkResult, error) var positionsMu sync.Mutex var eg errgroup.Group + // Set a parallelism limit to avoid hitting limits related to opening too many files. + // On Windows, this can show up as a runtime failure due to a thread limit. + eg.SetLimit(256) + err := filepath.Walk(location, func(path string, f os.FileInfo, err error) error { if err != nil { return err