Github user PSUdaemon commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1035#discussion_r79634032
  
    --- Diff: cmd/traffic_cop/traffic_cop.cc ---
    @@ -651,6 +661,26 @@ config_reload_records()
       config_read_int("proxy.config.cluster.rsport", &rs_port, true);
       config_read_int("proxy.config.cop.init_sleep_time", &init_sleep_time, 
true);
     
    +  config_read_int("proxy.config.cop.active_health_checks", &tmp, true);
    +  // 0 == No servers are killed
    +  // 1 == Only traffic_manager can be killed on failure
    +  // 2 == Only traffic_server can be killed on failure
    +  // 3 == Any failing healthchecks can cause restarts (default)
    +  switch (tmp) {
    +  case 0:
    +    active_health_checks = COP_KILL_NONE;
    +    break;
    +  case 1:
    +    active_health_checks = COP_KILL_MANAGER;
    +    break;
    +  case 2:
    +    active_health_checks = COP_KILL_SERVER;
    +    break;
    +  default:
    +    active_health_checks = COP_KILL_SERVER | COP_KILL_MANAGER;
    +    break;
    +  }
    +
    --- End diff --
    
    What do you think about skipping `tmp` and just saying something like:
    ```c++
    config_read_int("proxy.config.cop.active_health_checks", 
&active_health_checks, true);
    if ((active_health_checks < 0) || (active_health_checks > 3)) {
      active_health_checks = COP_KILL_SERVER | COP_KILL_MANAGER;
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to