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

feat: specify http completion for async queries #632

Merged
merged 4 commits into from
May 14, 2024
Merged

Conversation

bednar
Copy link
Contributor

@bednar bednar commented May 9, 2024

Closes #566

Proposed Changes

Use HttpCompletionOption.ResponseHeadersRead for async queries for possibility to use large queries then 2GiB. For more info see related issue.

For more info see: https://www.stevejgordon.co.uk/using-httpcompletionoption-responseheadersread-to-improve-httpclient-performance-dotnet

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • dotnet test completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@bednar bednar marked this pull request as ready for review May 9, 2024 12:21
@bednar bednar requested a review from karel-rehor May 9, 2024 12:21
Copy link
Contributor

@karel-rehor karel-rehor left a comment

Choose a reason for hiding this comment

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

Tests are all working locally. Changes make sense.

@bednar bednar merged commit 73988fb into master May 14, 2024
9 checks passed
@bednar bednar deleted the http-completion branch May 14, 2024 03:25
@bednar bednar added this to the 4.15.0 milestone May 14, 2024
@@ -115,9 +116,13 @@ public ApiClient(string basePath = "http://localhost/api/v2")
string path, Method method, List<KeyValuePair<string, string>> queryParams, object postBody,
Dictionary<string, string> headerParams, Dictionary<string, string> formParams,
Dictionary<string, FileParameter> fileParams, Dictionary<string, string> pathParams,
string contentType)
string contentType,
HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseContentRead)
Copy link

Choose a reason for hiding this comment

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

@bednar I am still hitting the buffer limit in 4.16.0 for large queries was the default suppose to be HttpCompletionOption.ResponseHeadersRead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the default value that should be overridden in our files. It seems like HttpCompletionOption.ResponseHeadersRead should also be set in the QueryApi file. As a workaround, can you try setting HttpClient.MaxResponseContentBufferSize in HttpClient? How to use a custom HttpClient is mentioned here: #528.

For more information, see:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created a prerelease version of the client with a fix from #649. Can you test the version 4.17.0-dev.headers.read.1? You can find it here: https://www.nuget.org/packages/InfluxDB.Client/4.17.0-dev.headers.read.1.

Copy link

@MD-NG MD-NG Jul 22, 2024

Choose a reason for hiding this comment

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

Hi thank you for the response. I tested the changes for #649 and it fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants