r2dbc / r2dbc-pool

Connection Pooling for Reactive Relational Database Connectivity
https://r2dbc.io
Apache License 2.0
337 stars 55 forks source link

Pool hangs when trying to get connections wich closed on server timeout (they remain idle in pool) #42

Closed MisteryX closed 5 years ago

MisteryX commented 5 years ago

Case:

  1. Executing queries in pool (releasing connections)
  2. Waiting sometime until server timeout is reached on pooled connections
  3. Trying to get connection from pool and... it hangs entire application forever (pool exhausted) When it hangs: ERROR [lettuce-epollEventLoop-4-2] dev.miku.r2dbc.mysql.client.ReactorNettyClient: Exchange cancelled while exchange is active. This is likely a bug leading to unpredictable outcome.

Mysql server 5.7.27, timeout = 180s

spring.r2dbc.connection-timeout=3s spring.r2dbc.pool.initial-size=10 spring.r2dbc.pool.max-size=200 spring.r2dbc.pool.max-idle-time=10s spring.r2dbc.pool.validation-query=SELECT 1 spring.r2dbc.pool.max-create-connection-time=3s spring.r2dbc.pool.max-acquire-time=5s spring.r2dbc.pool.max-life-time=180s

spring-data-r2dbc 1.0.0.RC1

r2dbc-pool 0.8.0.RC1

r2dbc-mysql 0.8.0.RC2

mp911de commented 5 years ago

Not sure this is a pool issue. Looks more related to the driver /cc @mirromutth

MisteryX commented 5 years ago

Connections with server timeout remain in pool as idle. If the most of the connections in pool stay idle but in fact they are closed...

MisteryX commented 5 years ago

I think, should be a trigger that processes events of server timeout/shutdown for particular connection in pool and actualizes connection statuses

mp911de commented 5 years ago

Yeah, that's already on our radar, see r2dbc/r2dbc-spi#35.

MisteryX commented 5 years ago

Thank you! Are there any forcasts or plans about this feature in SPI?

 

Пятница, 25 октября 2019, 13:00 +03:00 от Mark Paluch notifications@github.com:   Yeah, that's already on our radar, see r2dbc/r2dbc-spi#35 . — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or unsubscribe .    

Максим Морсков  

mp911de commented 5 years ago

A driver/pool impl cannot implement anything that isn’t specified yet.