Skip to content

Commit

Permalink
storagenode/monitor: ignore shutdown errors
Browse files Browse the repository at this point in the history
This fixes some flakyness in tests.

Change-Id: I535232c5d80827d6d72c73d61134f3b2806b5db9
  • Loading branch information
egonelbre authored and Storj Robot committed Aug 16, 2023
1 parent 93ce4a0 commit a3067b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions storagenode/monitor/monitor.go
Expand Up @@ -14,6 +14,7 @@ import (
"go.uber.org/zap"
"golang.org/x/sync/errgroup"

"storj.io/common/errs2"
"storj.io/common/memory"
"storj.io/common/pb"
"storj.io/common/sync2"
Expand Down Expand Up @@ -140,6 +141,9 @@ func (service *Service) Run(ctx context.Context) (err error) {
return service.VerifyDirReadableLoop.Run(ctx, func(ctx context.Context) error {
err := service.store.VerifyStorageDirWithTimeout(ctx, service.contact.Local().ID, timeout)
if err != nil {
if errs2.IsCanceled(err) {
return nil
}
if errs.Is(err, context.DeadlineExceeded) {
if service.Config.VerifyDirWarnOnly {
service.log.Error("timed out while verifying readability of storage directory", zap.Duration("timeout", timeout))
Expand All @@ -161,6 +165,9 @@ func (service *Service) Run(ctx context.Context) (err error) {
return service.VerifyDirWritableLoop.Run(ctx, func(ctx context.Context) error {
err := service.store.CheckWritabilityWithTimeout(ctx, timeout)
if err != nil {
if errs2.IsCanceled(err) {
return nil
}
if errs.Is(err, context.DeadlineExceeded) {
if service.Config.VerifyDirWarnOnly {
service.log.Error("timed out while verifying writability of storage directory", zap.Duration("timeout", timeout))
Expand Down

0 comments on commit a3067b7

Please sign in to comment.