Request queue is full
engeue626 opened this issue · 1 comments
engeue626 commented
I was going to do many calls for a spring reactive API, in which it SELECT a mysql table in trsaction. My calls were sent one by one(One
called after previous one got result). However for several times later. It throws following exception:
java.lang.IllegalStateException: Request queue is full
at dev.miku.r2dbc.mysql.client.RequestQueue.submit(RequestQueue.java:108) ~[r2dbc-mysql-0.8.2.RELEASE.jar!/:0.8.2.RELEASE]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ SQL "SELECT * FROM t_role WHERE service_id = :serviceId AND role in (:roles) AND sub_role = ''" [DatabaseClient]
|_ checkpoint ⇢ [check my ......]
|_ checkpoint ⇢ Handler com.lixiang.idaas.auth.controller.SubjectPermissionController#updateSubjectPermission(SubjectTypeEnum, String, Map) [DispatcherHandler]
|_ checkpoint ⇢ springfox.boot.starter.autoconfigure.SwaggerUiWebFluxConfiguration$CustomWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ com.alibaba.csp.sentinel.adapter.spring.webflux.SentinelWebFluxFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ HTTP PUT "/v1/subjects/app/swAppId" [ExceptionHandlingWebHandler]
Stack trace:
at dev.miku.r2dbc.mysql.client.RequestQueue.submit(RequestQueue.java:108) ~[r2dbc-mysql-0.8.2.RELEASE.jar!/:0.8.2.RELEASE]
at dev.miku.r2dbc.mysql.client.ReactorNettyClient.lambda$exchange$11(ReactorNettyClient.java:192) ~[r2dbc-mysql-0.8.2.RELEASE.jar!/:0.8.2.RELEASE]
at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:57) ~[reactor-core-3.4.3.jar!/:3.4.3]
at reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:62) ~[reactor-core-3.4.3.jar!/:3.4.3]
at dev.miku.r2dbc.mysql.util.FluxDiscardOnCancel.subscribe(FluxDiscardOnCancel.java:47) ~[r2dbc-mysql-0.8.2.RELEASE.jar!/:0.8.2.RELEASE]
at reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:62) ~[reactor-core-3.4.3.jar!/:3.4.3]
I am confused why the queue was full even my calls were sync.
Brozen commented
I also got this exception , just because a large number of concurrent DB queries occurs.
Fix it with a variable -Dreactor.bufferSize.small=4096
, but i think it's not a good idea to modify reactor-core ‘s default setting.
Maybe @mirromutth could provide a property to modify queue size in RequestQueue when initializing ConnectionFactory?