From d62723f038b86c0d5a7c5504235cea59ca5516f4 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 e37b2a4a..cc034a29 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" @@ -66,6 +67,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 {