You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by ijokarumawak <gi...@git.apache.org> on 2017/07/04 12:56:56 UTC

[GitHub] nifi pull request #1975: NIFI-3332: ListXXX to not miss files with the lates...

GitHub user ijokarumawak opened a pull request:

    https://github.com/apache/nifi/pull/1975

    NIFI-3332: ListXXX to not miss files with the latest processed timestamp

    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [ ] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [x] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ijokarumawak/nifi nifi-3332

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1975.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1975
    
----
commit 1e132be4c1cf1cc0debf37dc3dc2d38c93a94363
Author: Koji Kawamura <ij...@apache.org>
Date:   2017-06-14T06:21:01Z

    NIFI-4069: Make ListXXX work with timestamp precision in seconds or minutes
    
    - Refactored variable names to better represents what those are meant for.
    - Added deterministic logic which detects target filesystem timestamp precision and adjust lag time based on it.
    - Changed from using System.nanoTime() to System.currentTimeMillis in test because Java File API reports timestamp in milliseconds at the best granularity. Also, System.nanoTime should not be used in mix with epoch milliseconds because it uses arbitrary origin and measured differently.
    - Changed TestListFile to use more longer interval between file timestamps those are used by testFilterAge to provide more consistent test result because sleep time can be longer with filesystems whose timestamp in seconds precision.
    - Added logging at TestListFile.
    - Added TestWatcher to dump state in case assertion fails for further investigation.
    - Added Timestamp Precision property so that user can set if auto-detect is not enough
    - Adjust timestamps for ages test

commit bbe4319150deaf6f92671cd2849a2c1dc6d36fa7
Author: Koji Kawamura <ij...@apache.org>
Date:   2017-07-04T08:34:31Z

    NIFI-3332: ListXXX to not miss files with the latest processed timestamp
    
    Before this fix, it's possible that ListXXX processors can miss files those have the same timestamp as the one which was the latest processed timestamp at the previous cycle. Since it only used timestamps, it was not possible to determine whether a file is already processed or not.
    
    However, storing every single processed identifier as we used to will not perform well.
    Instead, this commit makes ListXXX to store only identifiers those have the latest timestamp at a cycle to minimize the amount of state data to store.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1975: NIFI-3332: ListXXX to not miss files with the latest proce...

Posted by bbende <gi...@git.apache.org>.
Github user bbende commented on the issue:

    https://github.com/apache/nifi/pull/1975
  
    @ijokarumawak was reviewing this, running a full build rebased against master i am consistently getting this test failure:
    
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    
    	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    	at java.util.ArrayList.get(ArrayList.java:429)
    	at org.apache.nifi.processors.standard.TestFTP.basicFileList(TestFTP.java:224)
    	
    Also, any reason why the junit dependency was changed from test to compile?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1975: NIFI-3332: ListXXX to not miss files with the latest proce...

Posted by ijokarumawak <gi...@git.apache.org>.
Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/1975
  
    @jskora Thanks for sharing your test result, glad to hear that worked!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1975: NIFI-3332: ListXXX to not miss files with the latest proce...

Posted by ijokarumawak <gi...@git.apache.org>.
Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/1975
  
    @bbende Thanks for reviewing this.
    
    This PR is now rebased with the latest master. The last commit includes following changes.
    
    The failing TestFTP.basicFileList has been added after I worked on this PR. It uses FakeFTPServer, which provides timestamp precision in minutes. Then this PR adds time precision auto detection by default. The file which was expected to be picked was not picked because it hadn't passed the required amount of lag time for minute precision. The test has been updated to use millisecond precision explicitly and also thread sleep has been added. The same error was confirmed in my environment, but it's been addressed.
    
    Similarly, I found that TestAbstractListProcessor tests can fail due to luck of time unit setting, when generated timestamp does not have the desired time unit value, e.g. generated '10:51:00' where second precision is tested. This has been addressed, too.
    
    Finally, the reason for changing junit dependency is ListProcessorTestWatcher. It resides in `nifi-processor-utils` and is used by the project and also `nifi-standard-processors` project. In order to share ListProcessorTestWatcher via nifi-processor-utils, I changed junit scope to 'compile' because it needs to be accessible from the 'main' source, not by 'test' source. But 'provided' is more reasonable in this case, so I've updated it to 'provided'. Without having a mechanism like ListProcessorTestWatcher, debugging test failures will be very difficult, especially if it happens occasionally in a remote environment such as Travis CI.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1975: NIFI-3332: ListXXX to not miss files with the latest proce...

Posted by bbende <gi...@git.apache.org>.
Github user bbende commented on the issue:

    https://github.com/apache/nifi/pull/1975
  
    Thanks for updating the PR! This looks good now, going to merge to master


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1975: NIFI-3332: ListXXX to not miss files with the latest proce...

Posted by ijokarumawak <gi...@git.apache.org>.
Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/1975
  
    As #1915 changes the same files and these two are related, I created this PR based on #1915.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1975: NIFI-3332: ListXXX to not miss files with the lates...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/1975


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1975: NIFI-3332: ListXXX to not miss files with the latest proce...

Posted by jskora <gi...@git.apache.org>.
Github user jskora commented on the issue:

    https://github.com/apache/nifi/pull/1975
  
    @ijokarumawak @bbende Sorry I haven't kept up with this recently.  I'm happy to say that I was able to do some preliminary testing and this appears to solve the problem!  **_Thanks!_**
    
    🥇 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---