ywkaras commented on a change in pull request #8098:
URL: https://github.com/apache/trafficserver/pull/8098#discussion_r673482790



##########
File path: proxy/http/remap/NextHopHealthStatus.cc
##########
@@ -149,3 +149,29 @@ NextHopHealthStatus::markNextHop(TSHttpTxn txn, const char 
*hostname, const int
     break;
   }
 }
+
+void
+NextHopHealthStatus::retryComplete(TSHttpTxn txn, const char *hostname, const 
int port)
+{
+  HttpSM *sm          = reinterpret_cast<HttpSM *>(txn);
+  ParentResult result = sm->t_state.parent_result;
+  int64_t sm_id       = sm->sm_id;
+
+  // make sure we're called back with a result structure for a parent that is 
being retried.
+  if (result.result != PARENT_SPECIFIED && !result.retry) {
+    return;
+  }
+
+  const std::string host_port = HostRecord::makeHostPort(hostname, port);
+  auto iter                   = host_map.find(host_port);
+  if (iter == host_map.end()) {
+    NH_Debug(NH_DEBUG_TAG, "[%" PRId64 "] no host named %s found in host_map", 
sm_id, host_port.c_str());
+    return;
+  }
+
+  std::shared_ptr h = iter->second;

Review comment:
       Nitpick:  I would make this `auto &retriers = iter->second->retriers;` 
to avoid creating a duplicate shared pointer and atomic increment/decrement of 
the reference count.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to