Constant MAX_RECHECKS

Source
const MAX_RECHECKS: u32 = 10;
Expand description

Number of times we’re willing to iterate round the state machine loop

Not the number of retries of failed descriptor downloads, circuits, etc.

The state machine loop is a condition variable loop. It repeatedly transforms the ServiceState to try to get to Open, converting stale data to Closed and Closed to Working, and so on. This ought only to go forwards so in principle we could use an infinite loop. But if we have a logic error, we want to crash eventually. The rechecks counter is for detecting such a situation.

This is fairly arbitrary, but we shouldn’t get anywhere near it.

Note that this is not a number of operational retries of fallible retriable operations. Such retries are handled in connect.rs.