[Proftpd-user] SQL reconnections and long-lived FTP sessions
TJ Saunders <tj <at> castaglia.org>
2009-03-10 18:35:49 GMT
When mod_sql is used, mod_sql creates a new database connection for each
FTP session. (Connection pooling can be done by using a third-party
application such as sqlrelay.) And if, during the lifetime of that FTP
session, the underlying database is stopped/started, the database
connection held by the FTP session process becomes invalid. The next SQL
operation attempted by mod_sql will result in something like:
Mar 10 10:29:13 mod_sql/4.2.2[25873]: message: 'Can't connect to local
MySQL server through socket '/tmp/mysql.sock' (2)'
For short-lived FTP sessions and/or for smarter FTP clients, the client
will reconnect to the FTP server, get a new server process, which gets a
new database connection to the (hopefully restored) database, and all
should be well.
However, longer-lived FTP sessions (or dumber FTP clients) are affected by
this.
My question for all you mod_sql users out there is: how big of a problem
is this? Should the SQL modules (mod_sql_mysql, mod_sql_postgres, et al)
try to automatically reconnect to the database when their database
connection is lost (for a given number of retries)? Note that, depending
on the database client library, attempting to reconnect may require
re-reading the client config file, which is impossible if that FTP session
has been chrooted; this is something that can be investigated. But first
I'd like to know whether this is something that would address pains that
proftpd users are actually seeing in the wild...
Cheers,
TJ
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Truth is within ourselves.
-Robert Browning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------------------------------------------------
_______________________________________________
ProFTPD Users List <proftpd-users <at> proftpd.org>
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html