-
Notifications
You must be signed in to change notification settings - Fork 37
Don't delete response collectors in a transaction #369
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
new Client(7, "Database name cannot be null."); | ||
public static final Client DB_DOES_NOT_EXIST = | ||
new Client(8, "The database '%s' does not exist."); | ||
public static final Client MISSING_RESPONSE = |
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.
See comments on https://github.com/vaticle/typedb-client-python/pull/250/files, which this PR is a copy of.
} | ||
|
||
@Test | ||
public void testStreaming() { |
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.
With these options (the default in TypeDB at time of writing), the server may respond with: 50 answers -> CONTINUE -> 1 answer [compensating for latency] -> DONE. The client will respond to CONTINUE with STREAM to keep iterating, and the server responds to STREAM with a 2nd DONE message.
This is expected and should be handled correctly (ie: ignored) by the client.
case STREAM_RES_PART: | ||
switch (resPart.getStreamResPart().getState()) { | ||
case DONE: | ||
stream.iteratorDone(requestID); |
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.
do we still need the bidirectional stream in this class at all?
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.
nvm!!
What is the goal of this PR?
We no longer delete response collectors in a transaction after receiving a response to a "single" request, or receiving a "DONE" message in a stream. This fixes a possible error when loading 50+ answers in one query and then performing a second query.
What are the changes implemented in this PR?
See typedb/typedb-driver-python#250, which this PR is a copy of.