Re: weird buildfarm failures on arm/mipsel and --with-tcl

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: weird buildfarm failures on arm/mipsel and --with-tcl
Date: 2007-01-28 21:49:50
Message-ID: 22677.1170020990@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> One possibility for fixing it is that maybe we should be making an
> effort to execute Tcl_Finalize() before exiting the backend. If so,
> having pltcl set up an on_proc_exit callback to do it would be the
> appropriate thing. This is all speculation though.

Just for grins I tried this, and I can see by strace'ing that it changes
the process-shutdown-time behavior quite a lot: the secondary thread now
exits first, apparently after being told to via a message from the
primary. So I think this might indeed be something good to do. Would
you try the attached patch and see if it changes the behavior on your
systems? (This patch is very ugly and will draw compiler warnings, but
don't worry about that yet.)

regards, tom lane

Index: pltcl.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v
retrieving revision 1.108
diff -c -r1.108 pltcl.c
*** pltcl.c 4 Oct 2006 00:30:14 -0000 1.108
--- pltcl.c 28 Jan 2007 21:45:40 -0000
***************
*** 26,31 ****
--- 26,32 ----
#include "fmgr.h"
#include "nodes/makefuncs.h"
#include "parser/parse_type.h"
+ #include "storage/ipc.h"
#include "tcop/tcopprot.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
***************
*** 245,250 ****
--- 246,253 ----
************************************************************/
if (!pltcl_be_init_done)
{
+ on_proc_exit(Tcl_Finalize, 0);
+
if (SPI_connect() != SPI_OK_CONNECT)
elog(ERROR, "SPI_connect failed");
pltcl_init_load_unknown(pltcl_norm_interp);

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-01-28 21:52:27 Re: Modifying and solidifying contrib
Previous Message David Fetter 2007-01-28 21:44:54 Re: Modifying and solidifying contrib