-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nydus-snapshotter: disable database flock timeout
Removing this timeout prevents the nydus-snapshotter from erroring out if there's already another instance running.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
packages/by-name/nydus-snapshotter/0001-disable-database-flock-timeout.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
From 6df4f8ea61ca8de08d7f2a87f9f80f2ba4b4513d Mon Sep 17 00:00:00 2001 | ||
From: Tom Dohrmann <[email protected]> | ||
Date: Tue, 27 Aug 2024 10:18:42 +0200 | ||
Subject: [PATCH] disable database flock timeout | ||
|
||
If there's another snapshotter instance running and that snapshotter | ||
has already acquired the file lock, we don't mind waiting indefinitely | ||
or until the other snapshotter dies. We don't want to fail because | ||
another snapshotter is already running. | ||
--- | ||
pkg/store/database.go | 3 +-- | ||
1 file changed, 1 insertion(+), 2 deletions(-) | ||
|
||
diff --git a/pkg/store/database.go b/pkg/store/database.go | ||
index c227a4a..101a7cf 100644 | ||
--- a/pkg/store/database.go | ||
+++ b/pkg/store/database.go | ||
@@ -12,7 +12,6 @@ import ( | ||
"encoding/json" | ||
"os" | ||
"path/filepath" | ||
- "time" | ||
|
||
"github.com/containerd/log" | ||
"github.com/containerd/nydus-snapshotter/pkg/daemon" | ||
@@ -56,7 +55,7 @@ func NewDatabase(rootDir string) (*Database, error) { | ||
return nil, err | ||
} | ||
|
||
- opts := bolt.Options{Timeout: time.Second * 4} | ||
+ opts := bolt.Options{} | ||
|
||
db, err := bolt.Open(f, 0600, &opts) | ||
if err != nil { | ||
-- | ||
2.45.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters