r2dbc-mysql icon indicating copy to clipboard operation
r2dbc-mysql copied to clipboard

[bug] Connection unexpectedly closed

Open andreas-ajaib opened this issue 1 year ago • 3 comments

Describe the bug A clear and concise description of what the bug is.

We frequently got Connection unexpectedly closed after updating to Spring Boot 2.7.x and asyncer:r2dbc-mysql 0.9.7.

Not stack trace, only this info:

"logger_name": "io.asyncer.r2dbc.mysql.client.ReactorNettyClient",
"message": "Connection unexpectedly closed"

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

andreas-ajaib avatar Apr 24 '24 10:04 andreas-ajaib

The issue arises because MySQL server disconnects your connection due to the wait_timeout setting. To address this, set your connection pool's max idle timeout < wait_timeout value.

jchrys avatar Apr 24 '24 14:04 jchrys

Hmm. Interesting. I checked the those configs and the max_idle_timeout is already way way less than wait_timeout.

andreas-ajaib avatar Apr 25 '24 01:04 andreas-ajaib

I think we could help you further, If you could share us minimum reproducible steps.

Please ensure that you are returning your connection to the pool correctly. I suggest escalating this issue to r2dbc-pool, as they handle connection management.

jchrys avatar Apr 25 '24 04:04 jchrys