[R-sig-DB] PostgreSQL killed on dbDisconnect (RPostgreSQL)

NISHIYAMA Tomoaki tomo@k|n @end|ng |rom @t@||@k@n@z@w@-u@@c@jp
Sun Feb 17 14:16:59 CET 2013


Dear Robert,

Since you are seeing crashes in the server side, which is probably very serious
problem for the PostgreSQL developers, I think it is best to contact their
mailing list.  With more specific version no. of the server and libpq etc.
Hopefully, they would direct you to collect information necessary to 
investigate the problem.

Best regards,

Tomoaki

On 2013/02/13, at 0: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.
> 
> 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




More information about the R-sig-DB mailing list