MCPcopy Create free account
hub / github.com/apache/trafficserver / markParentUp

Method markParentUp

src/proxy/ParentConsistentHash.cc:374–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374void
375ParentConsistentHash::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}

Callers 2

freeMethod · 0.45
markParentUpFunction · 0.45

Calls 2

numParentsFunction · 0.85
is_api_resultMethod · 0.80

Tested by

no test coverage detected