From a21bab1d5d90d7fdcf159bd29a2a74d5dde67adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Mon, 31 May 2021 18:32:16 +0300 Subject: [PATCH] Flash: Remove LocalRest workaround related comments Retry in event loop fixes the race between Channel contrustion and peer registering itself to the Flash registry. --- source/agora/flash/Channel.d | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/agora/flash/Channel.d b/source/agora/flash/Channel.d index 6b7d7d4e7b3..bbed4372522 100644 --- a/source/agora/flash/Channel.d +++ b/source/agora/flash/Channel.d @@ -108,8 +108,7 @@ public class Channel /// Ditto private OnUpdateComplete onUpdateComplete; - /// @WORKAROUND@: LocalRest issue with timings and sleep not working until - /// node ctor is done (see Flash restart tests) + /// Fetch the Flash Client for the peer private FlashAPI delegate (in PublicKey peer_pk, Duration timeout) getFlashClient; /// Retry delay algorithm @@ -524,8 +523,8 @@ public class Channel if (this.getState == ChannelState.Closed) return; - // if it's a preloaded channel we can only retrieve the flash client - // once the event loop is running (LocalRest issue) + // Peer might not registered yet at the time we construct + // the Channel, so we might need to re-try here in the event loop. if (this.peer is null) { this.peer = getFlashClient(this.peer_pk, this.flash_conf.timeout);