Sergiy Pavlov

Results comments of Sergiy Pavlov

@roji we've ran into the the same misunderstanding as in https://github.com/npgsql/npgsql/issues/4542#issuecomment-1173920910 of whether a "cancelled" NpgSqlReader ignores the remaining data in the pipe when disposed or reads to the end....

Understand. Just as a suggestion: when this happens, please expand on [NpgsqlDataReader.Close](https://www.npgsql.org/doc/api/Npgsql.NpgsqlDataReader.html#Npgsql_NpgsqlDataReader_Close) and [NpgsqlDataReader.CloseAsync](https://www.npgsql.org/doc/api/Npgsql.NpgsqlDataReader.html#Npgsql_NpgsqlDataReader_CloseAsync) by posting a remark similar to [SqlDataReader.Close](https://learn.microsoft.com/en-us/dotnet/api/microsoft.data.sqlclient.sqldatareader.close?view=sqlclient-dotnet-core-6.0#remarks): > ...This may be a long operation depending on...

I believe we have found the root cause for the symptoms reported here. The blocking seen in DotNetStats.UpdateMetrics (or similar areas) in this ticket could've been a side effect of...

@Florian3007 What `TargetSessionAttributes` value has been used in the provided scenario?

@karelz @davidsh Comment: System.Net.Http + System.Net.Http.WinHttpHandler NuGet v. 4.3.0 - based custom server runs out of IO Completion threads intermittently (at least once a week) due to this exact issue....

@davidsh @karelz Please follow up @EmmaZhu in the reference to [[CoreCLR][KnownIssue]Hang in when cancelling a request due a dead lock in .Net Core framework dotnet/corefx#47](https://github.com/Azure/azure-storage-net-data-movement/issues/47).

@davidsh Might help: [the parsed dump](https://docs.google.com/document/d/1zqrS8c_Yc2oH0Fe__hIXS7vSR7By80sSnULBdLRLkx0/edit?usp=sharing) showing all active threads with call stack and thread Id at the moment of the process failure. Let me know if there are any...

@karelz @davidsh Not exactly a repro but a summary of what our code does to get into the trouble state: - Multiple parallel tasks controlled by a shared cancellationTokenSource.Token_ **token0**...

Just a quick glance at the code related to disposing of WinHttpResponseStream._requestHandle field: is disposing of __requestHandle_ field done consistently? - There is a lock around _this._requestHandle.Dispose()_ in WinHttpResponseStream.CancelPendingResponseStreamReadOperation (that...

@davidsh FYI: We could not reproduce the deadlock in a test environment. We could not provide with the dump file either, as it contains production data. As a workaround, we...