diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-13 09:55:02 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-13 09:55:02 +0300 |
| commit | 8b586811571a9a3935a73deb47e6f37bb0c9bcbf (patch) | |
| tree | 9c8b8cea342622dbfe808a3ec9574de2c041dc56 | |
| parent | 32a3fe61700884d7378858ba21a809c31a9fc5eb (diff) | |
fix: log pprof.WriteHeapProfile error instead of silently ignoring it
Silent disk-full or permission-denied failures when writing the heap
profile are now surfaced via logln so the operator can diagnose them.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | internal/ior_profiling.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/ior_profiling.go b/internal/ior_profiling.go index 8ca3922..ddae088 100644 --- a/internal/ior_profiling.go +++ b/internal/ior_profiling.go @@ -100,7 +100,11 @@ func (p *profilingControl) stop(logln func(...any)) { logln("Stopping profiling and writing profile files") pprof.StopCPUProfile() runtime.GC() - _ = pprof.WriteHeapProfile(p.memProfile) + // Log any failure writing the heap profile (e.g. full disk, permission + // denied) so it is not silently swallowed. + if err := pprof.WriteHeapProfile(p.memProfile); err != nil { + logln("ERROR: failed to write heap profile:", err) + } p.stopExecTrace() _ = p.cpuProfile.Close() _ = p.memProfile.Close() |
