Uploaded image for project: 'Chukwa (retired)'
  1. Chukwa (retired)
  2. CHUKWA-668

Infinite loop in FileTailingAdaptor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6.0
    • 0.6.0
    • Data Collection
    • None
    • rotating and tailing file

    Description

      In LWFTAdaptor.java, lastSlurpTime is never updated, triggering an infinite loop if we use the
      adaptor FileTailingAdaptor and subclass adaptors.

      Loop occurs like this:
      1) lastSlurpTime is never changed and thus always 0.
      2) we append some data to the log file and we do a normal slurp
      3) after this slurp, we have: len == fileReadOffset && fixedNameLastModified > lastSlurpTime
      thus we think log file has rotated when it hasn't: fileReadOffset is reset to 0
      4) we get: len > fileReadOffset and so we do a slurp of len bytes.
      5) we are in the same situation as 3) -> infinite loop: the agent never stops sending chunks
      to the collector although log files does not change.

      It seems like this bug comes from CHUKWA-646. The first patch tailfile.patch seemed to do it
      right but in the second patch, the line "lastSlurpTime = System.currentTimeMillis();" just
      disapeared from LWFTAdaptor.java.

      Attachments

        1. chukwa-668-2.patch
          4 kB
          Sourygna Luangsay
        2. chukwa-668.patch
          2 kB
          Sourygna Luangsay

        Issue Links

          Activity

            People

              sourygna Sourygna Luangsay
              sourygna Sourygna Luangsay
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: