-
Notifications
You must be signed in to change notification settings - Fork 45
ResultSet: handle empty non-final pages on ResultSet iteration #102
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
Conversation
This commit provides a fix to the situation when iterating on a ResultSet, the driver aborts the iteration if the server returns an empty page even if there are next pages available. Python driver is affected by the same problem as JAVA-2934 This fix is similar to apache/cassandra-java-driver#1544
@@ -5133,6 +5133,7 @@ def next(self): | |||
if not self.response_future._continuous_paging_session: | |||
self.fetch_next_page() | |||
self._page_iter = iter(self._current_rows) | |||
return self.next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ultrabug this is identical to the next line after the if, how this fixes anything ?, do we have a test case to demonstrate this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not doing the same. It runs the whole method again (recursively). next(self)
not only calls next(self._page_iter)
but also has all the logic in lines 5127-5137.
Would it be inappropriate to ask for a unit test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @fruch
I'll try to add this on a second PR okay, first of all I need to make sure the current tests do fail because paging is supposed to be tested already... |
We have had one all along :-) See scylladb/scylladb#8203 - though they were in the context of Scylla, not the Python driver. |
This commit provides a fix to the situation when iterating on a
ResultSet, the driver aborts the iteration if the server returns
an empty page even if there are next pages available.
Python driver is affected by the same problem as JAVA-2934
This fix is similar to apache/cassandra-java-driver#1544