fixer-m / snowflake-db-net-client

Snowflake .NET Client
Apache License 2.0
51 stars 14 forks source link

The HttpRequestMessage reuse leads to the exception #31

Closed yzhoholiev closed 1 year ago

yzhoholiev commented 1 year ago

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. https://github.com/fixer-m/snowflake-db-net-client/blob/3c2a17cd2060ee1955964a8f852d78738d7c0857/Snowflake.Client/SnowflakeClient.cs#L231

fixer-m commented 1 year ago

@yzhoholiev Hi! Thanks for this report! This should be fixed now in 0.4.4.