-
Notifications
You must be signed in to change notification settings - Fork 155
Run response immediate processing update #897
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
dfc7a49
to
9ab3f57
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.
From what I understand it seems to make sense. Looks at least simpler in a positive way.
The core idea is not to pass that boolean
to ResultCursorFactoryImpl
and a new runFuture
, right?
Could you elaborate a bit more on the purpose of that runFucture
? By maybe choosing a different name?
driver/src/main/java/org/neo4j/driver/internal/handlers/RunResponseHandler.java
Show resolved
Hide resolved
.../main/java/org/neo4j/driver/internal/handlers/TransactionPullResponseCompletionListener.java
Outdated
Show resolved
Hide resolved
driver/src/test/java/org/neo4j/driver/integration/async/AsyncTransactionIT.java
Show resolved
Hide resolved
driver/src/main/java/org/neo4j/driver/internal/cursor/ResultCursorFactoryImpl.java
Show resolved
Hide resolved
Basically, yes. The |
Basic
Following this approach, the How about introducing doing a separate pull request and introducing a new common naming, like 'action`CompletionFuture (subject to discussion in that PR)? It might be easier from review standpoint. |
Following this approach, the I think |
As discussed, a separate PR will be created with renames to make them easier to review. |
f9cc023
to
86b6606
Compare
605194f
to
38ff211
Compare
This update makes `run` methods (session, tx) wait for successful request acknowledgement by the server. Specifically, the `Result` object will only be returned when there is a successful response from the server to the `RUN` message, meaning that the request was at least accepted by the server for processing. Otherwise, an appropriate error will be thrown. Additionally, this update makes the `Result.keys` method non-blocking and free from potential communication errors.
30ddc26
to
a23da89
Compare
9e8e6ad
to
e0df679
Compare
e0df679
to
1047741
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.
Thanks for the excellent walkthrough. I have tested the change afterwards with
- Neo4j-OGM 3.2.25-SNAPSHOT (no failures)
- Cypher-DSL main (no failures)
- Spring Data Neo4j 6.0.10-SNAPSHOT (one failure)
The failure was caused indirectly by our autoclosable query runner as it swallowed the target exception (see change here spring-projects/spring-data-neo4j@dcd422d).
We wouldn't have noticed the change in behavior otherwise, as we only consume via
try {
var result = s.run();
result.consume(); // or list, whatever
} catch(Whatever e) {
}
So in any case an exception would be handled.
Having said that, I would agree bringing this into the next patch.
This cataches and translations `ClientException` into the generic Neo4j-OGM `CypherException` while consuming the results too. It should fix spring-projects/spring-data-neo4j#2542 and is most likely necessary to encounter for the changes in neo4j/neo4j-java-driver#897.
This cataches and translations `ClientException` into the generic Neo4j-OGM `CypherException` while consuming the results too. It should fix spring-projects/spring-data-neo4j#2542 and is most likely necessary to encounter for the changes in neo4j/neo4j-java-driver#897.
This update makes
run
methods (session, tx) wait for successful request acknowledgement by the server. Specifically, theResult
object will only be returned when there is a successful response from the server to theRUN
message, meaning that the request was at least accepted by the server for processing. Otherwise, an appropriate error will be thrown.Additionally, this update also makes the
Result.keys
method non-blocking and free from potential communication errors.