Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
With the (relatively) recent improvements to buffer handling in TdsComm.cs an application is able to drive a lot of data through to the SQL Server. Depending on the nature of the load a reset packet is sometimes sent from the SQL Server side. Using Wireshark to examine the packets the attached packet is flagged by Wireshark informing that the TCP Window is full. As a result a RST packet is received from the SQL Server side shortly after and the application catches an exception.
I note that in TdsComm client, socket.NoDelay is being set to true to disable the Nagle algorithm. I'm not sure that in very large transfers this is a desirable behavior. However, even if I disable this option the application is still able to "drown" the server in data.
This didn't happen prior to the enhancement as the performance was slow enough that the SQL Server appears to be able to cope with the flow. Also, if an explicit delay is introduced between transmissions the problem also goes away. Might it be necessary to either:
- Turn off NOBLOCK to allow the TCP calls to block the application
- Use poll after a write to wait for the POLLOUT condition on that socket
Or is there some other mechanism that could be used?
Created attachment 1549 [details]
Wireshark capture of packet with TCP Window Full condition
A packet from a trace of the client side of a TDS session where Wireshark has detected the TCP Window Full condition. This later results in a RST packet being received from the server side causing an exception to be caught by the application.
Fixed in 8c2640437118b31b8d2033ec1da4fe0aa0ed4c5a.