Skip to content

Commit

Permalink
Incorporate PR feedback: Add limit to errorgroup
Browse files Browse the repository at this point in the history
Signed-off-by: kthatipally <[email protected]>
  • Loading branch information
kthatipally committed Jan 30, 2025
1 parent e002d57 commit 8669073
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions provider/internal/builtin/service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8669073

Please sign in to comment.