From a8d2a1b6dc381fee7c3e2add47e0b73377df5ba9 Mon Sep 17 00:00:00 2001 From: naure Date: Wed, 14 Aug 2024 16:00:20 +0200 Subject: [PATCH] sqs-polling (#240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aurélien Nicolas --- iris-mpc/src/bin/server.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iris-mpc/src/bin/server.rs b/iris-mpc/src/bin/server.rs index 4581a89e9..2eeb5560f 100644 --- a/iris-mpc/src/bin/server.rs +++ b/iris-mpc/src/bin/server.rs @@ -54,6 +54,7 @@ const SYNC_RESULTS: usize = MAX_BATCH_SIZE * 2; const SYNC_QUERIES: usize = MAX_BATCH_SIZE * 2; const_assert!(SYNC_QUERIES <= sync_nccl::MAX_REQUESTS); const MAX_ROLLBACK: usize = MAX_BATCH_SIZE * 2; +const SQS_POLLING_INTERVAL: Duration = Duration::from_secs(1); static CURRENT_BATCH_SIZE: LazyLock> = LazyLock::new(|| Mutex::new(MAX_BATCH_SIZE)); @@ -174,6 +175,8 @@ async fn receive_batch( batch_query.query_left.code.extend(iris_shares); batch_query.query_left.mask.extend(mask_shares); } + } else { + tokio::time::sleep(SQS_POLLING_INTERVAL).await; } } // TODO: also grab the right side from the batch once it is sent, ATM just