Skip to content

Commit e08ad3b

Browse files
committed
backupsink: drop pretty.Formatter log that crashes on Azure errors
When closing the underlying writer in FileSSTSink.Flush failed, we logged the error via pretty.Formatter, whose reflection walk dereferences unexported fields. With Azure SDK errors that embed *http.Response and internal buffers released by the SDK, this can dereference freed memory and SIGSEGV. The error is already wrapped and returned to the caller, so the warning was redundant. Drop the warning (and the now-unused kr/pretty import). Fixes #169668. Release note (bug fix): Fixed a possible SIGSEGV when a backup encountered a transient error writing to Azure Blob Storage.
1 parent 7e511cc commit e08ad3b

2 files changed

Lines changed: 0 additions & 3 deletions

File tree

pkg/backup/backupsink/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ go_library(
2626
"//pkg/util/unique",
2727
"@com_github_cockroachdb_errors//:errors",
2828
"@com_github_gogo_protobuf//types",
29-
"@com_github_kr_pretty//:pretty",
3029
],
3130
)
3231

pkg/backup/backupsink/file_sst_sink.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"github.com/cockroachdb/cockroach/pkg/util/log"
2626
"github.com/cockroachdb/errors"
2727
gogotypes "github.com/gogo/protobuf/types"
28-
"github.com/kr/pretty"
2928
)
3029

3130
var (
@@ -280,7 +279,6 @@ func (s *FileSSTSink) Flush(ctx context.Context) error {
280279
return err
281280
}
282281
if err := s.out.Close(); err != nil {
283-
log.Warningf(ctx, "failed to close write in FileSSTSink: % #v", pretty.Formatter(err))
284282
return errors.Wrap(err, "writing SST")
285283
}
286284
wroteSize := s.sst.Meta.Size

0 commit comments

Comments
 (0)