Skip to content

Commit

Permalink
In recent releases R is taking over SIGINT, which causes bad things
Browse files Browse the repository at this point in the history
to happen when query cancel is attempted. Take SIGINT back into
Postgres control. Report and test case by Terry Schmitt.
  • Loading branch information
jconway committed Jun 26, 2011
1 parent 3bd3a3e commit b1bda01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plr.c
Expand Up @@ -31,6 +31,7 @@
* plr.c - Language handler and support functions
*/
#include "plr.h"
#include "libpq/pqsignal.h"

PG_MODULE_MAGIC;

Expand Down Expand Up @@ -324,7 +325,7 @@ plr_init(void)
{
char *r_home;
int rargc;
char *rargv[] = {"PL/R", "--silent", "--no-save", "--no-restore"};
char *rargv[] = {"PL/R", "--slave", "--silent", "--no-save", "--no-restore"};

/* refuse to init more than once */
if (plr_pm_init_done)
Expand Down Expand Up @@ -390,6 +391,11 @@ plr_init(void)
R_Interactive = false;
#endif

/*
* R seems to try to steal SIGINT in recent releases, so steal it back
*/
pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */

plr_pm_init_done = true;
}

Expand Down

0 comments on commit b1bda01

Please sign in to comment.