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
r2dbc-mysql queueing execution of queries #343
r2dbc-mysql queueing execution of queries #343
Conversation
…actional' into feature/r2dbc-queueing-execution
(2) integration test should sleep enough time before shutdown connection
Thanks for the PR! Can you give some details on the suggested fix? |
@oshai, thank you for taking a look on this PR. What I mean by "unintended" is when you are in a transaction, cancelling the subscription of ongoing query publisher can cause an asynchronous ROLLBACK query to be executed using the same connection. This behavior is from the following code. The Mono.usingWhen(Mono.just(it),
ignore -> mono,
this.transactionManager::commit,
(res, err) -> Mono.empty(),
this.transactionManager::rollback
) It is "unintended" because a user cannot control the ROLLBACK query to be executed after the ongoing query is finished. As the jasync driver validates the connection before sending any query to the database, the above behavior will make jasync driver throw an exception since the ROLLBACK query cannot be executed simultaneously while the other query being executed using the same connection. This is critical because when this type of error occurs, resource cleanup fails, which means the connection is not returned to the connection pool and the number of idle connections in the pool are only decreased. In this PR, I added I didn't intend to introduce a behavior which is similar to query multiplexing with this PR. |
I have few ideas/options to make it simple:
What do you think? |
Thank you for better suggestions. |
This is my suggested fix for issue #255 (comment).
Since in reactor environment, multiple threads can access to the same connection unintendedly, I added a queue per
JasyncClientConnection
.