Skip to content

Commit

Permalink
p2p-governor: update inProgressPromoteWarm
Browse files Browse the repository at this point in the history
The connection monitoring needs to update inProgressPromoteWarm, by
removing peers that fail to be promoted.
  • Loading branch information
coot committed Oct 19, 2020
1 parent f1210d0 commit 944dc8e
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -98,7 +98,8 @@ connections PeerSelectionActions{peerStateActions = PeerStateActions {monitorPee
establishedPeers,
establishedStatus,
inProgressDemoteHot,
inProgressDemoteWarm
inProgressDemoteWarm,
inProgressPromoteWarm
} =
Guarded Nothing $ do
establishedStatus' <- traverse monitorPeerConnection establishedPeers
Expand Down Expand Up @@ -130,7 +131,15 @@ connections PeerSelectionActions{peerStateActions = PeerStateActions {monitorPee
. foldr
((snd .) . KnownPeers.incrementFailCount)
(knownPeers st)
$ (Map.keysSet demotedToCold)
$ (Map.keysSet demotedToCold),

-- When promoting a warm peer, it might happen
-- that the connection will break (or one of the
-- established protocols will error). For that
-- reason we need to adjust 'inProgressPromoteWarm'.
inProgressPromoteWarm
= inProgressPromoteWarm
Set.\\ Map.keysSet demotions
}
}
where
Expand Down

0 comments on commit 944dc8e

Please sign in to comment.