Conversation
Contributor
Author
|
Fixes #15 |
Contributor
|
I'm not familiar enough with how the Contract pattern works here to comment on the actual logic, but it would be helpful to see a test that exercised this 16k message with something simple like a select on a 16k string full of |
Contributor
Author
|
Added tests for both multiple data packets spanning >16k and one data packet with a size over >16k |
scotttrinh
approved these changes
Jul 24, 2023
Contributor
scotttrinh
left a comment
There was a problem hiding this comment.
Tests make sense, thanks for checking both cases! 🏆
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Netty transfers data to the binding in chunks of <=16k bytes at a time, the EdgeDB protocol can have messages with lengths over that size, therefor the binding must collect the chunks to build a complete message if the protocol message is >16k bytes.
The binding did attempt to do this with a contract structure, creating
PacketContracts for messages that can't be read with the provided buffer, ref:https://github.com/edgedb/edgedb-java/blob/abb7f8a797e0d2ec21c0ee4ba298022fa2cf06a9/src/driver/src/main/java/com/edgedb/driver/binary/PacketSerializer.java#L77-L98
although, this code failed to account for successful contracts with remaining data, ignoring it and misreading the protocol data.
This PR fixes that by correctly consuming the remaining data of a completed contract, as well as correctly handling cases where multiple chunks are sent for one large data message.