From 31e3382129f6a750f2d2eec840cc7bb1c2db80ce Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 13 Apr 2024 13:33:13 +0300 Subject: feat(tvix/*store/bigtable): limit retries connecting to cbtemulator This kept retrying indefinitely if the socket didn't appear. Change-Id: I4d4ef61df73cef6abda698501432f370abc8a82c Reviewed-on: https://cl.tvl.fyi/c/depot/+/11406 Autosubmit: flokli Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/castore/src/directoryservice/bigtable.rs | 4 +++- tvix/store/src/pathinfoservice/bigtable.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'tvix') diff --git a/tvix/castore/src/directoryservice/bigtable.rs b/tvix/castore/src/directoryservice/bigtable.rs index 372135628050..bee2fb15aeee 100644 --- a/tvix/castore/src/directoryservice/bigtable.rs +++ b/tvix/castore/src/directoryservice/bigtable.rs @@ -118,7 +118,9 @@ impl BigtableDirectoryService { .expect("failed to spwan emulator"); Retry::spawn( - ExponentialBackoff::from_millis(20).max_delay(Duration::from_secs(1)), + ExponentialBackoff::from_millis(20) + .max_delay(Duration::from_secs(1)) + .take(3), || async { if socket_path.exists() { Ok(()) diff --git a/tvix/store/src/pathinfoservice/bigtable.rs b/tvix/store/src/pathinfoservice/bigtable.rs index cb16830165de..f49ef475eb37 100644 --- a/tvix/store/src/pathinfoservice/bigtable.rs +++ b/tvix/store/src/pathinfoservice/bigtable.rs @@ -119,7 +119,9 @@ impl BigtablePathInfoService { .expect("failed to spwan emulator"); Retry::spawn( - ExponentialBackoff::from_millis(20).max_delay(Duration::from_secs(1)), + ExponentialBackoff::from_millis(20) + .max_delay(Duration::from_secs(1)) + .take(3), || async { if socket_path.exists() { Ok(()) -- cgit 1.4.1