Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Request queue is full #196

Open
engeue626 opened this issue Sep 3, 2021 · 1 comment
Open

Request queue is full #196

engeue626 opened this issue Sep 3, 2021 · 1 comment

Comments

@engeue626
Copy link

engeue626 commented Sep 3, 2021

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
Copy link

Brozen commented Apr 8, 2022

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants