This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: PostgreSQL and CVS DLL
- From: Jason Tishler <jason at tishler dot net>
- To: Norman Vine <nhv at cape dot com>
- Cc: cygwin-developers at cygwin dot com
- Date: Wed, 9 Jan 2002 12:01:21 -0500
- Subject: Re: PostgreSQL and CVS DLL
- References: <20020109162551.GE1672@dothill.com> <016501c1992c$45ef3580$a300a8c0@nhv>
Norman,
On Wed, Jan 09, 2002 at 11:39:56AM -0500, Norman Vine wrote:
> OK -- using snapshots from cygwin.com
>
> postgres runs fine using snapshot DLL dated 20011231
> crashes for me with all DLL's dated 20020104 and later
>
> I have a locally built DLL 20020103 that also crashes
Please try to determine what specific Cygwin change is causing the
postmaster problem. Since the date range is small, searching cygwin-cvs
should not take too long.
> FWIW
> In an attempt to see if this was just an introduced 'incompatability'
> with previous cygwin dlls I tried building postgres from scratch
> with todays Cygwin CVS files
> make check failed for me with < failed to createdb >
> This could be do to local error however as I am not all that
> familiar with the postgres build
> < I used script from Cygwin postgres distribution >
See attached for how to fix the above make check problem. I normal would
use an URL, but the PostgreSQL archvies are "under construction" right
now. Please read the README regarding other known make check problems.
Thanks,
Jason
--- Begin Message ---
- From: Tom Lane <tgl at sss dot pgh dot pa dot us>
- To: Jason Tishler <jason at tishler dot net>
- Cc: Pgsql-Patches <pgsql-patches at postgresql dot org>
- Date: Thu, 03 Jan 2002 16:55:45 -0500
- Subject: Re: [PATCHES] pg_regress.sh startup failure patch
- References: <20020103115553.GA496@dothill.com> <12844.1010071685@sss.pgh.pa.us> <20020103164215.GA1836@dothill.com> <13227.1010076426@sss.pgh.pa.us> <20020103192842.GA1380@dothill.com>
Jason Tishler <jason@tishler.net> writes:
> I just checked one of my old favorites, "The UNIX Programming
> Environment," by Kernighan and Pike, 1984. It appears that "until"
> is understood by the Bourne shell back then, so its use should be OK.
Yeah, that's what I thought. I ended up applying the attached patch;
this not only avoids the timing problem but has more reliable detection
of postmaster startup failure than the original code.
regards, tom lane
*** src/test/regress/pg_regress.sh.orig Sun Sep 16 12:11:11 2001
--- src/test/regress/pg_regress.sh Thu Jan 3 16:52:05 2002
***************
*** 353,358 ****
--- 353,379 ----
"$bindir/postmaster" -D "$PGDATA" -F $postmaster_options >"$LOGDIR/postmaster.log" 2>&1 &
postmaster_pid=$!
+ # Wait till postmaster is able to accept connections (normally only
+ # a second or so, but Cygwin is reportedly *much* slower). Don't
+ # wait forever, however.
+ i=0
+ max=60
+ until "$bindir/psql" $psql_options template1 </dev/null 2>/dev/null
+ do
+ i=`expr $i + 1`
+ if [ $i -ge $max ]
+ then
+ break
+ fi
+ if kill -0 $postmaster_pid >/dev/null 2>&1
+ then
+ : still starting up
+ else
+ break
+ fi
+ sleep 1
+ done
+
if kill -0 $postmaster_pid >/dev/null 2>&1
then
echo "running on port $PGPORT with pid $postmaster_pid"
***************
*** 363,371 ****
echo
(exit 2); exit
fi
-
- # give postmaster some time to pass WAL recovery
- sleep 3
else # not temp-install
--- 384,389 ----
--- End Message ---