Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-12231 FetchSmb supports Move and Delete Completion Strategies #8617

Closed
wants to merge 3 commits into from

Conversation

turcsanyip
Copy link
Contributor

@turcsanyip turcsanyip commented Apr 9, 2024

Summary

NIFI-12231

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 21

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration tests workflow failed on FetchSmbIT for the following tests:

FetchSmbIT.testCompletionStrategyDelete:114 expected: <false> but was: <true>
FetchSmbIT.testCompletionStrategyMoveWithCreatingDirectory:149 expected: <false> but was: <true>

@turcsanyip
Copy link
Contributor Author

The integration tests workflow failed on FetchSmbIT for the following tests:

FetchSmbIT.testCompletionStrategyDelete:114 expected: <false> but was: <true>
FetchSmbIT.testCompletionStrategyMoveWithCreatingDirectory:149 expected: <false> but was: <true>

Thanks for the heads-up @exceptionfactory!
I rerun the integration test on GitHub and got the same errors. So they are not intermittent.
However, I did not manage to replicate it in my environments. It worked on Mac and now I also set up a similar environment to GitHub Actions (same OS, Java and Docker versions) but no luck.
I pushed some changes in order to get more info and also modified the logic a bit (just trial-and-error approach).

Used different directory names for the test cases
Used variables for directory and file names
Add extra assertions for checking no warnings happen
@turcsanyip
Copy link
Contributor Author

turcsanyip commented May 4, 2024

@exceptionfactory I managed to fix the tests by changing the logic in FetchSmb.

There were 2 overlapping sessions to the SMB server: one for reading the file and the other for executing the completion strategy (move or delete) in commitAsync(). I moved the commit out of the TWR block of the first session, so the "read" session gets closed before the "move/delete" session starts.

Parallel sessions should not cause issues as the file handles are closed properly and it worked in my environments (ran flows connecting to Windows share and Samba share, ran integrations tests on Mac and Linux). Not sure what the docker environment is doing in Github CI but this change fixed it. I re-ran the integration tests 3 times and all were green.

@asfgit asfgit closed this in 9f69ff2 May 6, 2024
asfgit pushed a commit that referenced this pull request May 6, 2024
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #8617.
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes apache#8617.
shubhluck pushed a commit to shubhluck/nifi that referenced this pull request Jun 1, 2024
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes apache#8617.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants