Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4626

LogFile::close_file should not delete m_log handle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.0.0
    • Core
    • None

    Description

      When log file was deleted on the disk, LogFile::check_fd will close file handle and reopen again.delete m_log at this point will cause LogFile::open_file return "LOG_FILE_COULD_NOT_OPEN_FILE" . otherwise, will cause trafficserver crash at LogFile::preproc_and_try_delete

      300 if (!m_log->m_start_time) {
      (gdb) bt
      #0 0x000000000068245f in LogFile::preproc_and_try_delete (this=0x1132eb0, lb=0x7fffdc000da0) at LogFile.cc:300
      #1 0x000000000068caa6 in LogBufferManager::preproc_buffers (this=0x1132970, sink=0x1132eb0) at LogObject.cc:77
      #2 0x0000000000691a53 in LogObject::preproc_buffers (this=0x1132ae0, idx=0) at LogObject.h:146
      #3 0x00000000006901c3 in LogObjectManager::preproc_buffers (this=0x1127228, idx=0) at LogObject.cc:1126
      #4 0x000000000066b668 in Log::preproc_thread_main (args=0x1131edc) at Log.cc:1168
      #5 0x000000000066ce9d in LoggingPreprocContinuation::mainEvent (this=0x1131ea0) at Log.cc:279
      #6 0x000000000050d662 in Continuation::handleEvent (this=0x1131ea0, event=1, data=0x11529a0) at ../iocore/eventsystem/I_Continuation.h:153
      #7 0x00000000007a1e9f in EThread::execute (this=0x7ffff07a1010) at UnixEThread.cc:298
      #8 0x00000000007a0d0c in spawn_thread_internal (a=0x1131ef0) at Thread.cc:84
      #9 0x00007ffff64740a4 in start_thread (arg=0x7ffff07a0700) at pthread_create.c:309
      #10 0x00007ffff541c04d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      (gdb) p m_log
      $1 = (BaseLogFile *) 0x0

      Attachments

        Issue Links

          Activity

            People

              danobi Daniel Xu
              chaiman_ats Michael Chai
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h