| 351 | } |
| 352 | |
| 353 | int64_t Controller::backup_request_ms() const { |
| 354 | int timeout_ms = _backup_request_ms; |
| 355 | if (NULL != _backup_request_policy) { |
| 356 | const int32_t policy_ms = _backup_request_policy->GetBackupRequestMs(this); |
| 357 | // -1 is the designated sentinel: the policy defers to the channel-level |
| 358 | // backup_request_ms (set from ChannelOptions). Any other negative value |
| 359 | // disables backup for this RPC. Values >= 0 override directly. |
| 360 | if (policy_ms != -1) { |
| 361 | timeout_ms = policy_ms; |
| 362 | } |
| 363 | } |
| 364 | if (timeout_ms > 0x7fffffff) { |
| 365 | timeout_ms = 0x7fffffff; |
| 366 | LOG(WARNING) << "backup_request_ms is limited to 0x7fffffff (roughly 24 days)"; |
| 367 | } |
| 368 | return timeout_ms; |
| 369 | } |
| 370 | |
| 371 | void Controller::set_max_retry(int max_retry) { |
| 372 | if (max_retry > MAX_RETRY_COUNT) { |
no test coverage detected