Skip to content

Commit

Permalink
Flash: Remove LocalRest workaround related comments
Browse files Browse the repository at this point in the history
Retry in event loop fixes the race between Channel
contrustion and peer registering itself to the Flash
registry.
  • Loading branch information
omerfirmak authored and Geod24 committed May 31, 2021
1 parent 5eac9dd commit a21bab1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/agora/flash/Channel.d
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a21bab1

Please sign in to comment.