From 9857a20c0d44bf7c38b297e0653cb2bdbcc23b59 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 9 Jun 2022 14:10:01 +0300 Subject: [PATCH] [#1505] pilorama: Provide timeout to `bbolt.Open` Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/pilorama/boltdb.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/local_object_storage/pilorama/boltdb.go b/pkg/local_object_storage/pilorama/boltdb.go index 4abda70c7..0e35d86ca 100644 --- a/pkg/local_object_storage/pilorama/boltdb.go +++ b/pkg/local_object_storage/pilorama/boltdb.go @@ -7,6 +7,7 @@ import ( "math/rand" "os" "path/filepath" + "time" "github.com/nspcc-dev/neo-go/pkg/io" "github.com/nspcc-dev/neofs-node/pkg/util" @@ -68,6 +69,7 @@ func (t *boltForest) Open() error { opts := *bbolt.DefaultOptions opts.NoSync = t.noSync + opts.Timeout = 100 * time.Millisecond t.db, err = bbolt.Open(t.path, t.perm, &opts) if err != nil {