trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: TS-4626: LogFile::close_file should not delete m_log handle
Date Fri, 07 Oct 2016 15:44:00 GMT
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  3af46b1   TS-4626: LogFile::close_file should not delete m_log handle
3af46b1 is described below

commit 3af46b13d975ae1eee044dc934ba38e63ce5cee2
Author: Daniel Xu <dlxu2@yahoo.com>
AuthorDate: Wed Sep 28 12:42:54 2016 -0500

    TS-4626: LogFile::close_file should not delete m_log handle
    
    LogFile::close_file was incorrectly deleting the m_log object.
    This caused potential race conditions when flushing m_log since
    there aren't any locks protecting m_log accesses.
    
    When the underlying log file on disk is deleted, it is fine to
    not delete m_log. It's fine because the actual flush function
    in Log::flush_thread_main checks to see if m_log is open before
    doing any writes.
---
 proxy/logging/LogFile.cc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index 30cd31a..08a4968 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -237,8 +237,6 @@ LogFile::close_file()
     } else if (m_log) {
       m_log->close_file();
       Debug("log-file", "LogFile %s is closed", m_log->get_name());
-      delete m_log;
-      m_log = NULL;
     } else {
       Warning("LogFile %s is open but was not closed", m_name);
     }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message