Skip to content
Snippets Groups Projects
Commit 6107ebba authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

Merge remote-tracking branch 'origin/release' into release

parents ddd1dae8 f3856960
No related branches found
No related tags found
1 merge request!170Release
...@@ -93,13 +93,6 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -93,13 +93,6 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
oldestRound := networkInstance.GetOldestRoundID() oldestRound := networkInstance.GetOldestRoundID()
// Set a lower timeout so there is room for retries,
// while ensuring it does not go too low and cause too many timeouts
roundEventTimeout := 5 * time.Second
if timeout < roundEventTimeout {
roundEventTimeout = timeout
}
// Parse and adjudicate every round // Parse and adjudicate every round
for _, rnd := range roundList { for _, rnd := range roundList {
// Every round is timed out by default, until proven to have finished // Every round is timed out by default, until proven to have finished
...@@ -116,7 +109,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -116,7 +109,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
} else { } else {
// If in progress, add a channel monitoring its state // If in progress, add a channel monitoring its state
roundEvents.AddRoundEventChan(rnd, sendResults, roundEvents.AddRoundEventChan(rnd, sendResults,
roundEventTimeout, states.COMPLETED, states.FAILED) timeout-time.Millisecond, states.COMPLETED, states.FAILED)
numResults++ numResults++
} }
} else { } else {
...@@ -129,7 +122,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -129,7 +122,7 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
} else { } else {
// Otherwise, monitor its progress // Otherwise, monitor its progress
roundEvents.AddRoundEventChan(rnd, sendResults, roundEvents.AddRoundEventChan(rnd, sendResults,
roundEventTimeout, states.COMPLETED, states.FAILED) timeout-time.Millisecond, states.COMPLETED, states.FAILED)
numResults++ numResults++
} }
} }
...@@ -158,16 +151,13 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -158,16 +151,13 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
roundCallback(false, true, roundsResults) roundCallback(false, true, roundsResults)
return return
case roundReport := <-sendResults: case roundReport := <-sendResults:
// Skip if the round is timed out, meaning unknown from historical rounds
// or timed out on RoundEvents channel numResults--
// Skip if the round is nil (unknown from historical rounds)
// they default to timed out, so correct behavior is preserved
if roundReport.TimedOut { if roundReport.TimedOut {
// Generate a message to track the timed out round allRoundsSucceeded = false
timeoutRequest := &pb.HistoricalRounds{
Rounds: []uint64{roundReport.RoundInfo.ID},
}
// Request that round's information, feeding back into sendResults
jww.DEBUG.Printf("Sending HistoricalRounds retry for Round %d", roundReport.RoundInfo.ID)
go c.getHistoricalRounds(timeoutRequest, sendResults, commsInterface)
} else { } else {
// If available, denote the result // If available, denote the result
roundId := id.Round(roundReport.RoundInfo.ID) roundId := id.Round(roundReport.RoundInfo.ID)
...@@ -176,8 +166,8 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration, ...@@ -176,8 +166,8 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration,
} else { } else {
roundsResults[roundId] = Failed roundsResults[roundId] = Failed
allRoundsSucceeded = false allRoundsSucceeded = false
} }
numResults--
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment