You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by su...@apache.org on 2020/06/01 22:38:27 UTC

[trafficserver] branch master updated: Issue 6838 Fixing the comparison in waited_enough (drain functionality) (#6839)

This is an automated email from the ASF dual-hosted git repository.

sudheerv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 92a1f87  Issue 6838 Fixing the comparison in waited_enough (drain functionality) (#6839)
92a1f87 is described below

commit 92a1f87d14c7ab6444131dc30bf2b06af36000da
Author: VijayAnand Subramanian <vi...@gmail.com>
AuthorDate: Tue Jun 2 04:08:14 2020 +0530

    Issue 6838 Fixing the comparison in waited_enough (drain functionality) (#6839)
    
    Co-authored-by: Vijayanand Subramanian <vs...@synamedia.com>
---
 doc/admin-guide/files/records.config.en.rst | 7 +++++--
 src/traffic_manager/traffic_manager.cc      | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 87c0caa..2a24465 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -381,8 +381,11 @@ Thread Variables
    :reloadable:
 
    The shutdown timeout(in seconds) to apply when stopping Traffic
-   Server, in which ATS can initiate graceful shutdowns. It only supports
-   HTTP/2 graceful shutdown for now. Stopping |TS| here means sending
+   Server, in which ATS can initiate graceful shutdowns. In order
+   to effect graceful shutdown, the value specified should be greater
+   than 0. Value of 0 will not effect an abrupt shutdown. Abrupt
+   shutdowns can be achieved with out specifying --drain;
+   (traffic_ctl server stop /restart). Stopping |TS| here means sending
    `traffic_server` a signal either by `bin/trafficserver stop` or `kill`.
 
 .. ts:cv:: CONFIG proxy.config.thread.max_heartbeat_mseconds INT 60
diff --git a/src/traffic_manager/traffic_manager.cc b/src/traffic_manager/traffic_manager.cc
index 0a410e2..0ddb653 100644
--- a/src/traffic_manager/traffic_manager.cc
+++ b/src/traffic_manager/traffic_manager.cc
@@ -198,7 +198,7 @@ waited_enough()
     return false;
   }
 
-  return (lmgmt->mgmt_shutdown_triggered_at + timeout >= time(nullptr));
+  return (timeout ? (lmgmt->mgmt_shutdown_triggered_at + timeout <= time(nullptr)) : false);
 }
 
 static void