[R-sig-DB] PostgreSQL killed on dbDisconnect (RPostgreSQL)
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Tue Feb 12 16:18:47 CET 2013
Robert,
On 12 February 2013 at 10:05, McGehee, Robert wrote:
| Hi,
| Has anyone had an issue where a PostgreSQL connection was forcibly killed (SIGKILL) by RPostgreSQL, causing a full database crash/recovery/restart?
|
| This seems to happen about twice a week when a RPostgreSQL connection is closed using dbDisconnect (or when an R session ends) while other queries are running. The Linux OOM killer is not enabled on this server and I can find no evidence of hardware problems or any evidence of problems with the PostgreSQL database. This left me to wonder if there was a problem with the way RPostgreSQL (or R) disconnects that causes the database crash.
|
| I generally interface with RPostgreSQL inside a function like this:
|
| FUN <- function() {
| conn <- dbConnect(dbDriver("PostgreSQL"), host="xx", user="xx", password="xx", dbname="xx")
| on.exit(dbDisconnect(conn), add=TRUE)
| dbGetQuery("SELECT 1;", conn=conn)
| }
|
| I found record of a similar problem with the RpgSQL package here (from 2009):
| https://stat.ethz.ch/pipermail/r-help/2009-January/184707.html
| which indicates that dbDisconnect() caused a crash under similar circumstances in RpgSQL. However, in this case there was a crash in R; in my case there is a crash in PostgreSQL (and it's a different package).
|
| Has anyone else had a problem like this with RPostgreSQL or know if it is even possible for RPostgreSQL to send a SIGKILL signal to a PostgreSQL connection? I'm reluctant to remove dbDisconnect everywhere, as I don't want zombie connections accumulating. Also, I'm not the only user of the database.
We obviousy have a lot of connect/disconnect in the unit testing for
RPostgreSQL and this has never come up before.
This may be an iffy one to chase down as it could well depend on your load,
database, server version, ...
We will try to help where we can but without a reproducible example it is
difficult. Maybe you can locally mod your RPostgreSQL package and add
logging ?
There is a (very low-volume) list for RPostgreSQL which may be more appropriate.
Dirk
| Thanks, Robert
|
| _______________________________________________
| R-sig-DB mailing list -- R Special Interest Group
| R-sig-DB using r-project.org
| https://stat.ethz.ch/mailman/listinfo/r-sig-db
--
Dirk Eddelbuettel | edd using debian.org | http://dirk.eddelbuettel.com
More information about the R-sig-DB
mailing list