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

PHOENIX-6342 RoundRobinResultIterator doesn't close itself when resul… #1114

Closed
wants to merge 1 commit into from

Conversation

stoty
Copy link
Contributor

@stoty stoty commented Jan 27, 2021

…t size = fetchsize-1

@@ -114,6 +114,7 @@ public Tuple next() throws SQLException {
index = (index + 1) % size;
}
}
close();
Copy link
Contributor

Choose a reason for hiding this comment

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

When RRIterator#peek() (next result) is null, we close the iterator. But if we don't get any next result after looping through all RRIterators, we should close() here, that's the plan right?
Although this looks good, curious if caller can implement the logic of calling RRResultIterator#close() if RRResultIterator#next() returns null. But if caller logic turns out to be more complicated, sure we should go this route I believe.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems we already do have practice of closing iterators when next() exhausts all rows e.g ConcatResultIterator, LimitingResultIterator. I think we are good here.

Copy link
Contributor Author

@stoty stoty Jan 27, 2021

Choose a reason for hiding this comment

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

When RRIterator#peek() (next result) is null, we close the iterator. But if we don't get any next result after looping through all RRIterators, we should close() here, that's the plan right?

Yes. When all iterators set numScannersCacheExhausted , and we're at the end, getIterators() will return an empty collection, and close() is skipped.

Although this looks good, curious if caller can implement the logic of calling RRResultIterator#close() if RRResultIterator#next() returns null. But if caller logic turns out to be more complicated, sure we should go this route I believe.

This is is the pattern everywhere in the code. This is also less error-prone, and encapsulates the logic within the class, I see no reason to change this, either.

Copy link
Contributor

@virajjasani virajjasani left a comment

Choose a reason for hiding this comment

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

+1 (non-binding)

@stoty stoty closed this Jan 27, 2021
@stoty
Copy link
Contributor Author

stoty commented Jan 27, 2021

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚 mvninstall 15m 51s master passed
+0 hbaserecompile 22m 16s HBase recompiled.
+1 💚 compile 1m 3s master passed
+1 💚 checkstyle 0m 34s master passed
+1 💚 javadoc 0m 51s master passed
+0 🆗 spotbugs 3m 2s phoenix-core in master has 955 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 8m 21s the patch passed
+0 hbaserecompile 17m 47s HBase recompiled.
+1 💚 compile 1m 5s the patch passed
+1 💚 javac 1m 5s the patch passed
+1 💚 checkstyle 0m 35s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 51s the patch passed
+1 💚 spotbugs 3m 9s the patch passed
_ Other Tests _
-1 ❌ unit 111m 12s phoenix-core in the patch failed.
+1 💚 asflicense 0m 44s The patch does not generate ASF License warnings.
163m 55s
Reason Tests
Failed junit tests phoenix.end2end.PermissionNSEnabledIT
phoenix.end2end.PermissionsCacheIT
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1114
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
uname Linux 9ea94fa310ed 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / ba47233
Default Java Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Results https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/testReport/
Max. process+thread count 12456 (vs. ulimit of 30000)
modules C: phoenix-core U: phoenix-core
Console output https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1114/1/console
versions git=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@stoty stoty deleted the PHOENIX-6342 branch July 29, 2021 14:22
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