[GitHub] trafficserver pull request #1035: TS-4866: Makes traffic_cop killing optiona...

2016-09-22 Thread zwoop
Github user zwoop closed the pull request at:

https://github.com/apache/trafficserver/pull/1035


---
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.
---


[GitHub] trafficserver pull request #1035: TS-4866: Makes traffic_cop killing optiona...

2016-09-20 Thread PSUdaemon
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", _port, true);
   config_read_int("proxy.config.cop.init_sleep_time", _sleep_time, 
true);
 
+  config_read_int("proxy.config.cop.active_health_checks", , 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", 
_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.
---


[GitHub] trafficserver pull request #1035: TS-4866: Makes traffic_cop killing optiona...

2016-09-20 Thread zwoop
GitHub user zwoop opened a pull request:

https://github.com/apache/trafficserver/pull/1035

TS-4866: Makes traffic_cop killing optional

This adds a new configuration option, proxy.config.cop.active_health_checks:

 0 - traffic_cop is not allowed to kill any processes
 1 - Only traffic_manager can be killed on failed health checks
 2 - Only traffic_server can be killed on failed health checks
 3 - traffic_server and traffic_manager can be killed on failure (default)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/zwoop/trafficserver TS-4866

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafficserver/pull/1035.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1035


commit 6c609d4acbf9de7524527f720b68dcd62c982812
Author: Leif Hedstrom 
Date:   2016-09-19T22:19:25Z

TS-4866: Makes traffic_cop killing optional

This adds a new configuration option, proxy.config.cop.active_health_checks:

 0 - traffic_cop is not allowed to kill any processes
 1 - Only traffic_manager can be killed on failed health checks
 2 - Only traffic_server can be killed on failed health checks
 3 - traffic_server and traffic_manager can be killed on failure (default)




---
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.
---