diff --git a/pkg/chunk/local/boltdb_index_client.go b/pkg/chunk/local/boltdb_index_client.go index 55f5416212a..624e6ff4eda 100644 --- a/pkg/chunk/local/boltdb_index_client.go +++ b/pkg/chunk/local/boltdb_index_client.go @@ -140,7 +140,8 @@ func (b *boltIndexClient) getDB(name string) (*bbolt.DB, error) { } // Open the database. - db, err := bbolt.Open(path.Join(b.cfg.Directory, name), 0666, nil) + // Set Timeout to avoid obtaining file lock wait indefinitely. + db, err := bbolt.Open(path.Join(b.cfg.Directory, name), 0666, &bbolt.Options{Timeout: 5 * time.Second}) if err != nil { return nil, err }