-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Ensure BatchCursorFlux does not drop an error #1075
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
The BatchCursor class can be closed by the BatchCursorFlux class but there is no signalling for the BatchCursor onNext publisher. This leads to a next() called after the cursor was closed error and that breaks the reactive streams spec as the error ends up being dropped. JAVA-4849
This reverts commit 8ffbef4.
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.
Does the test reproduce the error reported in JAVA-4849? It looks rather different, and I'm having trouble understanding exactly how this fix relates to the original report.
...ams/src/test/functional/com/mongodb/reactivestreams/client/internal/BatchCursorFluxTest.java
Show resolved
Hide resolved
To add some more context - the "error" reported is a logging message similar to:
So the program works as expected it just logs an error as the default The test ensures that after the fix no https://projectreactor.io/docs/core/release/reference/#hooks-dropping |
Updated to check the parent sink to see if its been cancelled. This should be a better flag to use here. |
driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/BatchCursor.java
Show resolved
Hide resolved
...ams/src/test/functional/com/mongodb/reactivestreams/client/internal/BatchCursorFluxTest.java
Show resolved
Hide resolved
driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/BatchCursor.java
Outdated
Show resolved
Hide resolved
driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/BatchCursor.java
Show resolved
Hide resolved
...r-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/BatchCursorFlux.java
Show resolved
Hide resolved
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
The BatchCursor class can be closed by the BatchCursorFlux class but there is no signalling for the BatchCursor onNext publisher.
This leads to a next() called after the cursor was closed error and that breaks the reactive streams spec as the error ends up being dropped.
JAVA-4849