Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
700 stars 145 forks source link

Disconnected MySQL Connections #92

Open traufeisen opened 9 years ago

traufeisen commented 9 years ago

Hello, when Multicorn/SQLAlchemy needs to establish a new connection to a remote mysql server everything works fine. However, if the mysql server is closing the connection (for whatever reason), querying the mysql ends in a "MySQL server has gone away" error and leaving the current connection in an unuseable state. It's no longer possible to query the FDW until a new connection to postgres is made (as connections seem to be pooled per postgres process). This makes it difficult to use pgbouncer or other connections pools to postgres. It would be nice if Multicorn handles such disconnections and just tries to reconnect. SQLAlchemy also offers the possibility to pass options to "create_engine" (like pool_recycle), but those seem to be not accessable to the FDW.

Versions: Postgres 9.4 Multicorn 1.1.0