ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-8238

logrt may continue reading an old file repeatedly.

    Details

    • Type: Incident report Incident report
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.12, 2.2.3
    • Fix Version/s: 2.0.13rc1, 2.2.4rc1, 2.3.1
    • Component/s: Agent (G)
    • Labels:
    • Environment:
      RHEL6.5

      Description

      When the size of a file new after log rotation is 0 byte, reading the log of an old file will be continued.

      --after log rotation
      Zabbix
      key_=logrt[/var/log/test.log]
      lastlogsize=1000
      mtime=5/16 19:23

      old file
      filename=test.log-20140517
      logsize=1000
      mtime=5/16 19:23

      new file
      filename=test.log
      logsize=0
      mtime=5/17 03:06

      --In process_logrt() First

      ①process_log()
      It reads to the last of the old file.
      ②if (i != logfiles_num - 1)
      lastlogsize is set as zero.
      ③process_log()
      Since file size is the same as lastlogsize, mtime is not updated but it returns SUCCESS.

      lastlogsize=0 ←Only lastlogsize is updated.
      mtime=5/16 19:23

      --In process_logrt() Second....

      ①process_log()
      It reads to the last of the old file.
      ②if (i != logfiles_num - 1)
      lastlogsize is set as zero.
      ③process_log()
      Since file size is the same as lastlogsize, mtime is not updated but it returns SUCCESS.

      lastlogsize=0 ←Only lastlogsize is updated.....
      mtime=5/16 19:23

      1. for_2.2.3.patch
        0.5 kB
        Yoshinori Komuro
      2. zbx-8238-2.0.12.patch
        0.8 kB
        Andris Mednis
      3. zbx-8238-2.2.3.patch
        0.8 kB
        Andris Mednis

        Activity

        Hide
        Oleksiy Zagorskyi added a comment -

        Might be duplicate of ZBX-7098.
        Yoshinori, please review.

        Show
        Oleksiy Zagorskyi added a comment - Might be duplicate of ZBX-7098 . Yoshinori, please review.
        Hide
        Andris Mednis added a comment - - edited

        This is not a duplicate of ZBX-7098. It is a regression caused by my fix of ZBX-6729 and ZBX-6731, affecting 2.0.12 and 2.2.3.
        Yesterday a fix for ZBX-7098 was committed into 2.0.13rc1, 2.2.4rc1. I was not able to reproduce the issue ZBX-8238 with the fix ZBX-7098.

        Show
        Andris Mednis added a comment - - edited This is not a duplicate of ZBX-7098 . It is a regression caused by my fix of ZBX-6729 and ZBX-6731 , affecting 2.0.12 and 2.2.3. Yesterday a fix for ZBX-7098 was committed into 2.0.13rc1, 2.2.4rc1. I was not able to reproduce the issue ZBX-8238 with the fix ZBX-7098 .
        Hide
        Andris Mednis added a comment - - edited

        Thanks, Yoshinori, for reporting the issue and patch! Small modification of patch

        +		if (NULL != mtime)
        +			*mtime = (int)buf.st_mtime;
        

        to prevent crash on log[] items.

        Show
        Andris Mednis added a comment - - edited Thanks, Yoshinori, for reporting the issue and patch! Small modification of patch + if (NULL != mtime) + *mtime = ( int )buf.st_mtime; to prevent crash on log[] items.
        Show
        Andris Mednis added a comment - Documented in "Known issues" https://www.zabbix.com/documentation/2.0/manual/installation/known_issues https://www.zabbix.com/documentation/2.2/manual/installation/known_issues
        Hide
        Andris Mednis added a comment - - edited

        Patches for 2.0.12 and 2.2.3 available in attachments. Please review and test.

        Andris Zeila 2.0.12 patch successfully tested

        Show
        Andris Mednis added a comment - - edited Patches for 2.0.12 and 2.2.3 available in attachments. Please review and test. Andris Zeila 2.0.12 patch successfully tested
        Hide
        Andris Mednis added a comment - - edited

        While not absolutely necessary, this patch improves also current 2.0 and 2.2 (with fix ZBX-7098 applied). For Zabbix 2.0 available in development branch svn://svn.zabbix.com/branches/dev/ZBX-8238-20.

        Andris Zeila Tested ZBX-8238-20 dev branch

        Show
        Andris Mednis added a comment - - edited While not absolutely necessary, this patch improves also current 2.0 and 2.2 (with fix ZBX-7098 applied). For Zabbix 2.0 available in development branch svn://svn.zabbix.com/branches/dev/ZBX-8238-20. Andris Zeila Tested ZBX-8238 -20 dev branch
        Hide
        Andris Mednis added a comment -

        Fixed in versions pre-2.0.13 r45917, pre-2.2.4 r45927, pre-2.3.1 r45931.

        Show
        Andris Mednis added a comment - Fixed in versions pre-2.0.13 r45917, pre-2.2.4 r45927, pre-2.3.1 r45931.
        Hide
        Volker Fröhlich added a comment - - edited

        A backported patch for this issue is used in the following Fedora/EPEL packages:

        zabbix-2.0.12-2.fc19
        zabbix-2.0.12-2.fc20
        zabbix-2.2.3-3.fc21
        zabbix20-2.0.12-1.el5
        zabbix20-2.0.12-1.el6
        zabbix20-2.0.12-2.el7

        Show
        Volker Fröhlich added a comment - - edited A backported patch for this issue is used in the following Fedora/EPEL packages: zabbix-2.0.12-2.fc19 zabbix-2.0.12-2.fc20 zabbix-2.2.3-3.fc21 zabbix20-2.0.12-1.el5 zabbix20-2.0.12-1.el6 zabbix20-2.0.12-2.el7

          People

          • Assignee:
            Unassigned
            Reporter:
            Yoshinori Komuro
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: