From 1491262492298ead8539ec2f948ab56224edfd0b Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Mon, 15 Apr 2024 10:10:41 +0200 Subject: [PATCH] worker: move threadedUploadPackedSlabs out of bufferSizeLimitReached block --- internal/test/e2e/cluster.go | 6 +++++- worker/upload.go | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/test/e2e/cluster.go b/internal/test/e2e/cluster.go index 16b3acbfd..1a47a4e9a 100644 --- a/internal/test/e2e/cluster.go +++ b/internal/test/e2e/cluster.go @@ -19,6 +19,7 @@ import ( "go.sia.tech/jape" "go.sia.tech/renterd/api" "go.sia.tech/renterd/autopilot" + "go.sia.tech/renterd/build" "go.sia.tech/renterd/bus" "go.sia.tech/renterd/config" "go.sia.tech/renterd/internal/node" @@ -421,7 +422,10 @@ func newTestCluster(t *testing.T, opts testClusterOptions) *TestCluster { tt.OK(busClient.UpdateSetting(ctx, api.SettingS3Authentication, api.S3AuthenticationSettings{ V4Keypairs: map[string]string{test.S3AccessKeyID: test.S3SecretAccessKey}, })) - tt.OK(busClient.UpdateSetting(ctx, api.SettingUploadPacking, api.UploadPackingSettings{Enabled: enableUploadPacking})) + tt.OK(busClient.UpdateSetting(ctx, api.SettingUploadPacking, api.UploadPackingSettings{ + Enabled: enableUploadPacking, + SlabBufferMaxSizeSoft: build.DefaultUploadPackingSettings.SlabBufferMaxSizeSoft, + })) // Fund the bus. if funding { diff --git a/worker/upload.go b/worker/upload.go index 00c0a924b..144021a3c 100644 --- a/worker/upload.go +++ b/worker/upload.go @@ -202,11 +202,11 @@ func (w *worker) upload(ctx context.Context, r io.Reader, contracts []api.Contra } } } - - // make sure there's a goroutine uploading the remainder of the packed slabs - go w.threadedUploadPackedSlabs(up.rs, up.contractSet, lockingPriorityBackgroundUpload) } + // make sure there's a goroutine uploading any packed slabs + go w.threadedUploadPackedSlabs(up.rs, up.contractSet, lockingPriorityBackgroundUpload) + return eTag, nil }