]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/cov: close counter data files eagerly
authorThan McIntosh <thanm@google.com>
Tue, 16 Jul 2024 19:13:47 +0000 (19:13 +0000)
committerThan McIntosh <thanm@google.com>
Tue, 16 Jul 2024 20:20:05 +0000 (20:20 +0000)
commit355711821eea51c6456a31ab61d0dc2e9db034f7
tree6043f2a2d18287a07c4af06b5b78c80ec0a8a617
parentf2bcab5fb3436144c750e48934b4829111d407d6
cmd/internal/cov: close counter data files eagerly

When reading the counter data files from a given pod, close the
underlying *os.File immediately after each one is read, as opposed to
using a deferred close in the loop (which will close them all at the
end of the function). Doing things this way avoids running into "too
many open files" when processing large clumps of counter data files.

Fixes #68468.

Change-Id: Ic1fe1d36c44d3f5d7318578cd18d0e65465d71d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/598735
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/internal/cov/readcovdata.go