-
Notifications
You must be signed in to change notification settings - Fork 888
JAVA-2934: Handle empty non-final pages in ReactiveResultSetSubscription #1544
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
1e9767e
to
8c2e369
Compare
9892300
to
c9b1c95
Compare
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.
Nice and elegant :-)
Could you please:
- Add a unit test for this specific case in
ReactiveResultSetSubscriptionTest
- Change the commit and PR name to
JAVA-2934: Handle empty non-final pages in ReactiveResultSetSubscription
- Add an entry to the changelog:
4.12.0 (in progress)
- [bug] JAVA-2934: Handle empty non-final pages in ReactiveResultSetSubscription
Thanks!
c9b1c95
to
43471c0
Compare
43471c0
to
24a3aac
Compare
@adutra I fixed PR. Could you re-review my PR ? |
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.
Looking good, please do the changes I suggested and this should be good to go. Thank you for your time and involvement!
...va/com/datastax/dse/driver/internal/core/cql/reactive/ReactiveResultSetSubscriptionTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/datastax/dse/driver/internal/core/cql/reactive/TestSubscriber.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/datastax/dse/driver/internal/core/cql/reactive/TestSubscriber.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/datastax/dse/driver/internal/core/cql/reactive/TestSubscriber.java
Outdated
Show resolved
Hide resolved
...va/com/datastax/dse/driver/internal/core/cql/reactive/ReactiveResultSetSubscriptionTest.java
Outdated
Show resolved
Hide resolved
...va/com/datastax/dse/driver/internal/core/cql/reactive/ReactiveResultSetSubscriptionTest.java
Outdated
Show resolved
Hide resolved
b481664
to
8eea388
Compare
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.
Thank you so much @dssysolyatin !
Thank you for reviewing of PR @adutra |
@dssysolyatin sorry I forgot the legal part :-) I need you to sign our CLA please: Please ping me when you've signed it. Many thanks! |
@adutra No problem. Done ;) |
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
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
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
Hi !
I tried to use this driver with scylladb database, because it supports CQL protocol. But code started to hang for some queries:
The reason is that scylladb sometime returns a page with no data but with pagingState != null and it leads to code hanging
For instance, if
pages
queue contains three pages:pagingState
!= nullpagingState
!= nullpagingState
= nullAkka stream calls
request(1)
if it needs data andrequest
callsdrain
that sends one row to akka stream subscriber. It works well for pages with data. But if there is page without data andpagingState
!= null the following situation appears:Akka stream calls
requests(1)
that callsdrain
that callstryNext
.tryNext
method detects that there is no data anymore in page1
and it gets second page frompages
queue. But because of second page has no data, tryNext() will returnnull
and no data will be sent to akka stream subscriber. Because no data will be sent to akka subscriber, akka stream will not callrequest(1)
anymore anddrain
will not be called from anywhere because all pages are already loaded.I don't know why scylladb returns pages without data and
pagingState
!= null. I will ask scylladb team, but it also would be good to fix this case in driver as well