r2dbc/r2dbc-mssql

r2dbc mssql connectiontimeout exception

psishodhiya opened this issue · 1 comments

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

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