Details
Description
What is the problem
https://github.com/couchbase/backup/blob/cheshire-cat/cmd/cbbackupmgr/restore.go#L328
stat, err := startStatCollector(a, "restore", ctx.repository)
|
if err != nil {
|
clog.Warnf("(Stats) Could not start stat collection: %v", err)
|
}
|
defer stat.Stop() //nolint:errcheck
|
We create a stats collector and check the error which is correct. startStatCollector returns a nil StatCollector if there's an error, which means our call to Stop panics with a nil deref.
What is the fix
Whenever we call stat.Stop we should do a nil check.
Attachments
Issue Links
- relates to
-
MB-50494 [System Test][CBM] adding backup to s3 repository failed with error - failed to stop pool: failed to upload file: failed to complete upload: failed to stop worker pool: failed to upload part: RequestError: send request failed
- Closed