-
Notifications
You must be signed in to change notification settings - Fork 32
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
MssqlConnectionClosedException: Connection unexpectedly closed #248
Comments
I am seeing the same issue. Have you found any workaround? I wonder if there is a way to test for closed connections in the connection pool? |
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem. Random issues are very difficult to investigate and we need sufficient details to be able to reproduce it. |
I see the same problem using 1.0.1.RELEASE. I use Microsoft SQL Server 16.00.4035 as well as Microsoft SQL Server 15.00.2101. I happens not always, only in half of the requests with local SQL Server. In our test environment (Azure) it is more often. I'm doing SELECTs only including 4-6 columns of strings and number, no blob. Unfortunately, this is a show stopper for us. For me it is reproducable but I cannot provide my code since this is closed source. How can I help to investigate this? A colleque of mine who developed this code didn't see the problem on his local machine at all. Maybe this something about timeouts? Thx,
|
I think I figured out the root cause of this: As mentioned in README.md this driver uses direct execution per default. This does not support back-pressure handling! If your client is not able to forward data as fast as the database wants to push records then the database drops the connection. A workaround for this is to use cursor based execution by setting property This solved the problem for me 😃. (Unfortunately, as this is solved now I see another error is rare cases: |
Thanks a lot for your investigation, I'd be never able to find that cause without having your context ❤️. We addressed the prepared statement issue with #271. Can you retest with the latest snapshot to see whether the issue is resolved for you? I'd appreciate a reproducer for the case you mentioned. Maybe there is something we can still do from our side to capture the critical limit of queued responses so that we either do something smart about it or that we terminate the connection with a more meaningful exception. |
Hello,
I am getting the below exception happening in Production. It is random issue and once I get the issue, it is not inserting the data into the DB for particular time and after sometimes the record is getting inserted into DB. We are loosing few records in the DB because of this exception.
Please suggest asap. Let me know if you need more information.
org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection nested exception is io.r2dbc.mssql.client.ReactorNettyClient$MssqlConnectionClosedException: Connection unexpectedly closed
…
…
Caused by: io.r2dbc.mssql.client.ReactorNettyClient$MssqlConnectionClosedException: Connection unexpectedly closed
at io.r2dbc.mssql.client.ReactorNettyClient.handleClose(ReactorNettyClient.java:612) ~[r2dbc-mssql-0.8.6.RELEASE.jar!/:0.8.6.RELEASE]
at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:202) ~[reactor-core-3.4.7.jar!/:3.4.7]
The text was updated successfully, but these errors were encountered: