r2dbc / r2dbc-mssql

R2DBC Driver for Microsoft SQL Server using TDS (Tabular Data Stream) Protocol
Apache License 2.0
183 stars 32 forks source link

r2dbc mssql connectiontimeout exception #239

Closed psishodhiya closed 2 years ago

psishodhiya commented 2 years ago

We are using R2dbcEntityTemplate to fetch/read custom query resultset into the flux. We are consuming this stream of flux using rest service , flow is working fine but the issue is for the same request we are getting connection timeout exception though Database connectivity is fine. Due to this our api is not stable , could you please suggest here what could be wrong here.

We are creating connectionfactory by using below : new MssqlConnectionFactory(MssqlConnectionConfiguration.builder().host(url).port(port).database().username().password().build());

Actually due to company policy i can not upload stack trace , but i have attached the image of stack trace. We are running on mssql availability group . Not using any r2dbc pooling. I have tried same request hitting multiple times , pattern is like first request returns data then 2nd request stuck for 30seconds and throws exception ,then for 3rd request after few min again it goes success. For the same request behaviour is different. Could you please suggest what wrong i might be doing. 20211214_162317

mp911de commented 2 years ago

Connection timeouts are infrastructure problems and nothing we can solve here.