-
Notifications
You must be signed in to change notification settings - Fork 184
High CPU usage when cancelled query #242
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
Comments
Caused by #231. |
I've made a reproducer project at https://github.com/steven-sheehy/r2dbc-highcpu Please checkout and debug |
Thanks a lot. The issue is that we react to whether the buffer has buffered protocol frames but not whether the conversation has demand. The drain loop keeps looping forever. It actually should exit if the conversation has no demand. |
The drainloop is now left if the current conversation has no demand. [#242]
The drainloop is now left if the current conversation has no demand. [#242]
I just pushed a fix for this one. The test case runs after upgrading to |
Thanks, I can confirm it addresses the high CPU |
Bug Report
Using 0.8.1 in our project and running into an issue where we see very high CPU utilization after performing a simple select on a table. The below jstack output shows some sort of infinite loop in
io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.drainLoop(ReactorNettyClient.java:828)
.Also, after the query is completed and returned the appropriate results,
pg_stat_activity
still shows that query as active even though it should've been completed and returned to the pool. I've confirmed with logs for doOnCancel and doOnComplete that this flux is actually complete. Eventually all connections in the thread pool show as active and the thread pool is exhausted. It's not clear if these are related or two separate issues.Versions
Current Behavior
Application logs
jstack output
Table schema
Steps to reproduce
Expected behavior/code
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: