| 372 | } |
| 373 | |
| 374 | void |
| 375 | ParentConsistentHash::markParentUp(ParentResult *result) |
| 376 | { |
| 377 | pRecord *pRec; |
| 378 | |
| 379 | // Make sure that we are being called back with a |
| 380 | // result structure with a parent that is being retried |
| 381 | ink_release_assert(result->retry == true); |
| 382 | ink_assert(result->result == PARENT_SPECIFIED); |
| 383 | if (result->result != PARENT_SPECIFIED) { |
| 384 | return; |
| 385 | } |
| 386 | // If we were set through the API we currently have not failover |
| 387 | // so just return fail |
| 388 | if (result->is_api_result()) { |
| 389 | ink_assert(0); |
| 390 | return; |
| 391 | } |
| 392 | |
| 393 | ink_assert((result->last_parent) < numParents(result)); |
| 394 | pRec = parents[result->last_lookup] + result->last_parent; |
| 395 | pRec->available = true; |
| 396 | Dbg(dbg_ctl_parent_select, "%s:%s(): marked %s:%d available.", __FILE__, __func__, pRec->hostname, pRec->port); |
| 397 | |
| 398 | pRec->failedAt = static_cast<time_t>(0); |
| 399 | int old_count = pRec->failCount.exchange(0, std::memory_order_relaxed); |
| 400 | |
| 401 | if (old_count > 0) { |
| 402 | Note("http parent proxy %s:%d restored", pRec->hostname, pRec->port); |
| 403 | } |
| 404 | } |
no test coverage detected