Skip to content
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

Query: Fixes "System.ArgumentException: Stream was not readable." when using WithParameterStream #3155

Merged
merged 7 commits into from
Apr 29, 2022

Conversation

kr-santosh
Copy link
Contributor

@kr-santosh kr-santosh commented Apr 22, 2022

Description

The query definition holds the memory stream passed in by the user (this was introduced to support query on encrypted properties). That stream is then read and disposed to send the query over the wire. The issue is the query plan will be serialized multiple times for cases like cross partition queries and for scenarios where the query plan cannot be generated locally. Reserializing the query plan seems to be by design because the query plan can rewrite the query.

The fix reads the stream upfront to a string which is stored and later passed.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)

Closing issues

To automatically close an issue: closes #3152

abhijitpai
abhijitpai previously approved these changes Apr 22, 2022
@j82w j82w changed the title Query: Fixes issue with disposed stream being accessed when query plan was to be serialized multiple times for cases like cross partition queries etc. Query: Fixes "System.ArgumentException: Stream was not readable." when using WithParameterStream Apr 25, 2022
Copy link
Contributor

@neildsh neildsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@j82w j82w merged commit 9411d26 into master Apr 29, 2022
@j82w j82w deleted the users/sakulk/paramStreamFix branch April 29, 2022 00:25
j82w pushed a commit that referenced this pull request May 5, 2022
…n using WithParameterStream (#3155)

The query definition holds the memory stream passed in by the user (this was introduced to support query on encrypted properties). That stream is then read and disposed to send the query over the wire. The issue is the query plan will be serialized multiple times for cases like cross partition queries and for scenarios where the query plan cannot be generated locally. Reserializing the query plan seems to be by design because the query plan can rewrite the query.

The fix reads the stream upfront to a string which is stored and later passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QueryDefinition.WithParameterStream causes System.ArgumentException: Stream was not readable.
6 participants