Skip to content

Commit ae01265

Browse files
Avoid refreshing BftScanConnection too often when less than f scans are failing (#1151)
--------- Signed-off-by: Oriol Muñoz <oriol.munoz@digitalasset.com>
1 parent 73f51f8 commit ae01265

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

apps/scan/src/main/scala/org/lfdecentralizedtrust/splice/scan/admin/api/client/BftScanConnection.scala

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,14 @@ class BftScanConnection(
132132
retryProvider.timeouts,
133133
"refresh_scan_list",
134134
)({ tc =>
135-
// This retry makes sure any partial or complete failures are immediately retried with a backoff.
135+
// refresh will throw if we're in a state where there's no BFT guarantees, in which case
136+
// this will retry faster than the regular `bft.scansRefreshInterval`
136137
FutureUnlessShutdown.outcomeF(
137138
retryProvider.retry(
138139
RetryFor.LongRunningAutomation,
139140
"refresh_scan_list",
140141
"refresh_scan_list",
141-
bft.refresh(this)(tc).flatMap { connections =>
142-
if (connections.failed > 0)
143-
Future.failed(
144-
io.grpc.Status.UNAVAILABLE
145-
.withDescription("Deliberately enforcing a retry on failed scans.")
146-
.asRuntimeException()
147-
)
148-
else Future.unit
149-
},
142+
bft.refresh(this)(tc),
150143
logger,
151144
)(implicitly, TraceContext.empty, implicitly)
152145
)

0 commit comments

Comments
 (0)