From 66c444442f305e3480f1a87648881a003f1e7bc6 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Thu, 7 Nov 2024 11:32:57 +0100 Subject: [PATCH] limit amount of slot queue workers to 1 reason: proof generation does not happen in separate threads yet, so to avoid taking too long to provide initial storage proofs we only pick up one slot at a time --- codex/sales/slotqueue.nim | 2 +- tests/codex/sales/testsales.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codex/sales/slotqueue.nim b/codex/sales/slotqueue.nim index 198ef80f..78bda548 100644 --- a/codex/sales/slotqueue.nim +++ b/codex/sales/slotqueue.nim @@ -58,7 +58,7 @@ type QueueNotRunningError* = object of SlotQueueError # Number of concurrent workers used for processing SlotQueueItems -const DefaultMaxWorkers = 3 +const DefaultMaxWorkers = 1 # Cap slot queue size to prevent unbounded growth and make sifting more # efficient. Max size is not equivalent to the number of slots a host can diff --git a/tests/codex/sales/testsales.nim b/tests/codex/sales/testsales.nim index 3d142d16..661c6bd2 100644 --- a/tests/codex/sales/testsales.nim +++ b/tests/codex/sales/testsales.nim @@ -311,7 +311,7 @@ asyncchecksuite "Sales": createAvailability() # enough to fill a single slot await market.requestStorage(request) let items = SlotQueueItem.init(request) - await sleepAsync(10.millis) # queue starts paused, allow items to be added to the queue + await allowRequestToStart() check eventually queue.paused # The first processed item/slot will be filled (eventually). Subsequent # items will be processed and eventually re-pushed with `seen = true`. Once