You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "yknoya (via GitHub)" <gi...@apache.org> on 2023/05/15 00:21:24 UTC

[GitHub] [trafficserver] yknoya opened a new pull request, #9709: fix: consider the case where m_start_time is 0 in BaseLogFile::roll

yknoya opened a new pull request, #9709:
URL: https://github.com/apache/trafficserver/pull/9709

   # Problem
   In the second and subsequent log rolling, the start date of the log file name is set to "19700101" when all of the following conditions are met.
   * proxy.config.log.rolling_allow_empty is set to 1
   * there is no writing to the log file
   
   # How to reproduce
   1. Set the following configuration to records.yaml
   ```
     log:
       rolling_enabled: 1
       rolling_interval_sec: 60
       rolling_allow_empty: 1
   ```
   2. Set the following configuration to logging.yaml
   ```
   ---
   logging:
     formats:
     - name: sample
       format: "%<cqtd> %<cqtt> %<cquuc> %<crc>"
     logs:
     - mode: ascii
       filename: access
       format: sample
   ```
   3. Launch Traffic Server
   4. After waiting a few minutes, the following logs are created
   ```
   access.log_{hostname}.20230413.09h19m45s-20230413.09h20m00s.old
   access.log_{hostname}.19700101.09h00m00s-20230413.09h21m00s.old
   access.log_{hostname}.19700101.09h00m00s-20230413.09h22m00s.old
   access.log_{hostname}.19700101.09h00m00s-20230413.09h23m00s.old
   access.log_{hostname}.19700101.09h00m00s-20230413.09h24m00s.old
   access.log_{hostname}.19700101.09h00m00s-20230413.09h25m00s.old
   ```
   
   # Cause
   After the log rolling, m_start_time is reset and never been updated if there is no writing to the log file.
   https://github.com/apache/trafficserver/blob/fc0690bdb407871ca2ae5c309553fe9925bb586f/src/tscore/BaseLogFile.cc#L199
   https://github.com/apache/trafficserver/blob/fc0690bdb407871ca2ae5c309553fe9925bb586f/proxy/logging/LogFile.cc#L441
   
   So,  the start date of the log file name is set to "19700101" because it isn't checked whether m_start_time is 0 in BaseLogFile::roll.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] bneradt commented on pull request #9709: fix: consider the case where m_start_time is 0 in BaseLogFile::roll

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on PR #9709:
URL: https://github.com/apache/trafficserver/pull/9709#issuecomment-1570866096

   Thank you for the fix @yknoya . 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] masaori335 commented on pull request #9709: fix: consider the case where m_start_time is 0 in BaseLogFile::roll

Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 commented on PR #9709:
URL: https://github.com/apache/trafficserver/pull/9709#issuecomment-1547057592

   [approve ci]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ezelkow1 commented on pull request #9709: fix: consider the case where m_start_time is 0 in BaseLogFile::roll

Posted by "ezelkow1 (via GitHub)" <gi...@apache.org>.
ezelkow1 commented on PR #9709:
URL: https://github.com/apache/trafficserver/pull/9709#issuecomment-1554921414

   [approve ci centos]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] bneradt merged pull request #9709: fix: consider the case where m_start_time is 0 in BaseLogFile::roll

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt merged PR #9709:
URL: https://github.com/apache/trafficserver/pull/9709


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org