about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-13T10·33+0300
committerflokli <flokli@flokli.de>2024-04-13T12·01+0000
commit31e3382129f6a750f2d2eec840cc7bb1c2db80ce (patch)
treedb6f4c6cf528534f2d1c737484b09585cf7127d2
parent0dd421414e0bf111269329a113753e0bf8591204 (diff)
feat(tvix/*store/bigtable): limit retries connecting to cbtemulator r/7906
This kept retrying indefinitely if the socket didn't appear.

Change-Id: I4d4ef61df73cef6abda698501432f370abc8a82c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11406
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
-rw-r--r--tvix/castore/src/directoryservice/bigtable.rs4
-rw-r--r--tvix/store/src/pathinfoservice/bigtable.rs4
2 files changed, 6 insertions, 2 deletions
diff --git a/tvix/castore/src/directoryservice/bigtable.rs b/tvix/castore/src/directoryservice/bigtable.rs
index 3721356280..bee2fb15ae 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 cb16830165..f49ef475eb 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(())