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-6185: ListDatabaseTables processor doesn't close ResultSets #3405

Closed
wants to merge 1 commit into from

Conversation

lfrancke
Copy link
Member

@lfrancke lfrancke commented Apr 3, 2019

All this does is add two try-with-resources blocks. All the whitespace changes are only due to the new indentation of the blocks.

I have not added/changed the unit tests because honestly I wasn't sure how to test for this.

@lfrancke
Copy link
Member Author

lfrancke commented Apr 3, 2019

I believe the failed Travis builds to be unrelated.

@ijokarumawak
Copy link
Member

The Travis build failures look like timeouts, not related to this change. I have successfully ran contrib-check locally with this PR. Change looks good tome, +1. Merging to master.

Do you see the same 'too many open cursors' error with other SQL processors, for example ExecuteSQL querying Oracle? I'm wondering if we need to fix those as well. Currently AbstractExecuteSQL doesn't close ResultSet.
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractExecuteSQL.java#L256

Thanks @lfrancke for fixing this!

@asfgit asfgit closed this in 73571ae Apr 4, 2019
@lfrancke
Copy link
Member Author

lfrancke commented Apr 4, 2019

Thank you for the quick turnaround @ijokarumawak

I didn't look at all processors but AbstractExecuteSQL does close ResultSets implicitly via hasResults = st.getMoreResults(Statement.CLOSE_CURRENT_RESULT);

https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractExecuteSQL.java#L352

@lfrancke lfrancke deleted the NIFI-6185 branch April 4, 2019 05:32
@ijokarumawak
Copy link
Member

That's right, thanks @lfrancke! I only looked at the code around ResultSet, not with the statement :)

lfrancke added a commit to lfrancke/nifi that referenced this pull request Apr 9, 2019
This closes apache#3405.

Signed-off-by: Koji Kawamura <ijokarumawak@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants