You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/03/07 22:08:30 UTC

[trafficserver] branch 7.1.x updated: s3_auth: check if previous config (re)load failed

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

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new 037c106  s3_auth: check if previous config (re)load failed
037c106 is described below

commit 037c1069d7a11ef05bceffaa2ab5b43a1d1662d1
Author: Gancho Tenev <ga...@apache.org>
AuthorDate: Wed Mar 7 13:08:52 2018 -0800

    s3_auth: check if previous config (re)load failed
    
    before releasing the old configuration
    
    (cherry picked from commit 20db74bc0d0bf8e2d83e2c92a83274bb713196c7)
---
 plugins/s3_auth/s3_auth.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/s3_auth/s3_auth.cc b/plugins/s3_auth/s3_auth.cc
index 57f6d5b..78148bc 100644
--- a/plugins/s3_auth/s3_auth.cc
+++ b/plugins/s3_auth/s3_auth.cc
@@ -493,7 +493,10 @@ ConfigCache::get(const char *fname)
 
       TSDebug(PLUGIN_NAME, "Configuration from %s is stale, reloading", config_fname.c_str());
       it->second.second = tv.tv_sec;
-      it->second.first->release();
+      if (nullptr != it->second.first) {
+        // The previous config update / reload attempt did not fail, safe to call release.
+        it->second.first->release();
+      }
       if (s3->parse_config(config_fname)) {
         it->second.first = s3;
       } else {

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.