Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav committed Dec 20, 2023
1 parent fa02d84 commit a48e64e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/services/relay/evm/mercury/wsrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ func (w *client) handleTimeout(err error) {
cnt := w.consecutiveTimeoutCnt.Add(1)
if cnt == MaxConsecutiveRequestFailures {
w.logger.Errorf("Timed out on %d consecutive transmits, resetting transport", cnt)
// NOTE: If we get 5+ request timeouts in a row, close and re-open
// the websocket connection.
// NOTE: If we get at least MaxConsecutiveRequestFailures request
// timeouts in a row, close and re-open the websocket connection.
//
// This *shouldn't* be necessary in theory (ideally, wsrpc would
// handle it for us) but it acts as a "belts and braces" approach
Expand All @@ -284,11 +284,11 @@ func (w *client) handleTimeout(err error) {
select {
case w.chResetTransport <- struct{}{}:
default:
// This can happen if we had 5 consecutive timeouts, already
// sent a reset signal, then the connection started working
// again (resetting the count) then we got 5 additional
// failures before the runloop was able to close the bad
// connection.
// This can happen if we had MaxConsecutiveRequestFailures
// consecutive timeouts, already sent a reset signal, then the
// connection started working again (resetting the count) then
// we got MaxConsecutiveRequestFailures additional failures
// before the runloop was able to close the bad connection.
//
// It should be safe to just ignore in this case.
//
Expand Down

0 comments on commit a48e64e

Please sign in to comment.