Commit Graph

8 Commits

Author SHA1 Message Date
Tonis Tiigi
13bd25cd58 db: move DB dependencies to transactor interface
This allows more flexible control over DB transactions
and compaction.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-07-25 12:55:16 -07:00
fanjiyun.fjy
e75d776294 bboltcachestorage: only delete link after releasing result
Signed-off-by: fanjiyun.fjy <fanjiyun.fjy@alibaba-inc.com>
2024-07-03 11:08:29 +08:00
Tonis Tiigi
ccc06b7ffe bboltcachestorage: mitigate corrupt boltdb cache after panic
There are some reports that the nosync configuration of the boltdb can
cause panics on restarts due to corruption of the database. Mitigate by
panic recovery until there is a better solution.

Co-authored-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-05-31 15:02:24 -05:00
Chris Goller
4d4fc4dbd9 fix(boltdb): close cache and history dbs on exit
Signed-off-by: Chris Goller <goller@gmail.com>
2023-08-30 17:47:24 -05:00
Eng Zer Jun
be6501b654 test: use T.TempDir to create temporary test directory
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-07-24 02:27:26 +08:00
Sebastiaan van Stijn
21e9e9641e Remove uses of deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-10 00:57:07 +01:00
Tonis Tiigi
5da4a40ae8 lint: enable more linters
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:36 -07:00
John Howard
2de2c04c8e Revendoring to move boltdb to bbolt
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-09-18 11:18:08 -07:00