| 227 | } |
| 228 | |
| 229 | void timeout() |
| 230 | { |
| 231 | if (pinged) { |
| 232 | timeouts++; // No pong has been received before the timeout. |
| 233 | if (timeouts >= maxSlavePingTimeouts) { |
| 234 | // No pong has been received for the last |
| 235 | // 'maxSlavePingTimeouts' pings. |
| 236 | markUnreachable(); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | // NOTE: We keep pinging even if we schedule a transition to |
| 241 | // UNREACHABLE. This is because if the slave eventually responds |
| 242 | // to a ping, we can cancel the UNREACHABLE transition. |
| 243 | ping(); |
| 244 | } |
| 245 | |
| 246 | // Marking slaves unreachable is rate-limited and can be canceled if |
| 247 | // a pong is received before `_markUnreachable` is called. |
no outgoing calls
no test coverage detected