2021-04-30 12:56:36 +02:00
|
|
|
module github.com/google/nixery
|
|
|
|
|
|
|
|
go 1.15
|
|
|
|
|
|
|
|
require (
|
2022-05-26 11:58:01 +02:00
|
|
|
cloud.google.com/go/storage v1.22.1
|
2021-10-29 19:13:19 +02:00
|
|
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
2022-05-26 11:58:01 +02:00
|
|
|
github.com/google/go-cmp v0.5.8
|
fix(nixery): Avoid race when the same image is fetched in parallel
Remove a race condition which appears when uploadHashLayer is called
with the same key from multiple threads simultaneously. This can
easily happen when the same image path is requested by multiple
clients at the same time. When it does, a 500 status is returned and
the following error message is logged:
{
"context": {
"filePath": "github.com/google/nixery/builder/builder.go",
"lineNumber": 440,
"functionName": "github.com/google/nixery/builder.uploadHashLayer"
},
"error": "rename /var/lib/nixery/staging/<hash> /var/lib/nixery/layers/<hash>: no such file or directory",
"eventTime": "...",
"layer": "<hash>",
"message": "failed to move layer from staging",
...
}
To solve this issue, introduce a mutex keyed on the uploaded hash and
move all layer caching into uploadHashLayer. This could additionally
provide a small performance benefit when an already built image is
requested and NIXERY_PKGS_PATH is set, since symlink layers and config
layers are now also cached.
Change-Id: I50788a7ec7940cb5e5760f244692e361019a9bb7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6695
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2022-09-19 09:30:28 +02:00
|
|
|
github.com/im7mortal/kmutex v1.0.1 // indirect
|
2022-05-26 11:58:01 +02:00
|
|
|
github.com/pkg/xattr v0.4.7
|
2021-04-30 12:56:36 +02:00
|
|
|
github.com/sirupsen/logrus v1.8.1
|
2022-05-26 11:58:01 +02:00
|
|
|
golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401
|
|
|
|
gonum.org/v1/gonum v0.11.0
|
2021-04-30 12:56:36 +02:00
|
|
|
)
|