Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10568

SftpChangedExclusiveReadLockStrategy integer overflow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.18.0
    • 2.17.5, 2.18.2, 2.19.0
    • camel-sftp
    • None
    • Novice

    Description

      It looks like CAMEL-9820 has not resolved SFTP readLockMinAge functionality.

      When I run the latest version, I get a new last modified time as negative. I think this is because both types are int so it is performing the calculation as an int and then converting it to long.

      It should work if this line:

      newLastModified = f.getAttrs().getMTime() * 1000;

      Is changed to:

      newLastModified = f.getAttrs().getMTime() * 1000L;

      TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - List files outgoing/Promo/dev/test.dat found 1 files
      TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - Previous last modified: -9223372036854775808, new last modified: -616826120
      TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - Previous length: -9223372036854775808, new length: 12921172
      TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - New older than threshold: 1481147995902
      TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - Read lock acquired.

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              adamcampbell Adam Campbell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: