wrapper to choose between a remap next hop strategy or use parent.config remap next hop strategy is preferred
| 233 | // wrapper to choose between a remap next hop strategy or use parent.config |
| 234 | // remap next hop strategy is preferred |
| 235 | inline static void |
| 236 | markParentDown(HttpTransact::State *s) |
| 237 | { |
| 238 | url_mapping *mp = s->url_map.getMapping(); |
| 239 | |
| 240 | TxnDbg(dbg_ctl_http_trans, "enable_parent_timeout_markdowns: %d, disable_parent_markdowns: %d", |
| 241 | s->txn_conf->enable_parent_timeout_markdowns, s->txn_conf->disable_parent_markdowns); |
| 242 | |
| 243 | if (s->txn_conf->disable_parent_markdowns == 1) { |
| 244 | TxnDbg(dbg_ctl_http_trans, "parent markdowns are disabled for this request"); |
| 245 | return; |
| 246 | } |
| 247 | |
| 248 | if (s->current.state == HttpTransact::INACTIVE_TIMEOUT) { |
| 249 | if (s->txn_conf->enable_parent_timeout_markdowns == 0) { |
| 250 | return; |
| 251 | } |
| 252 | Metrics::Counter::increment(http_rsb.total_parent_marked_down_timeout); |
| 253 | } |
| 254 | // Increment metric when config allows ATS to mark parent down |
| 255 | Metrics::Counter::increment(http_rsb.total_parent_marked_down_count); |
| 256 | |
| 257 | if (s->response_action.handled) { |
| 258 | // Do nothing. If a plugin handled the response, let it handle markdown. |
| 259 | } else if (mp && mp->strategy) { |
| 260 | mp->strategy->markNextHop(reinterpret_cast<TSHttpTxn>(s->state_machine), s->parent_result.hostname, s->parent_result.port, |
| 261 | NH_MARK_DOWN); |
| 262 | } else if (s->parent_params) { |
| 263 | s->parent_params->markParentDown(&s->parent_result, s->txn_conf->parent_fail_threshold, s->txn_conf->parent_retry_time); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | // wrapper to choose between a remap next hop strategy or use parent.config |
| 268 | // remap next hop strategy is preferred |
no test coverage detected