Skip to content

The HttpRequestMessage reuse leads to the exception #31

Closed
@yzhoholiev

Description

@yzhoholiev

Given: send the query
When: the session is expired
Then: the request should be retried with the newly obtained session

Expected result: The request is successfully made.
Actual result: The exception is thrown:

System.InvalidOperationException: The request message was already sent. Cannot send the same request message multiple times.

The issue is in the HttpRequestMessage instance reuse during the retry. A new instance should be created for every request.

response = await _restClient.SendAsync<QueryExecResponse>(queryRequest, ct).ConfigureAwait(false);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions