Skip to content

Commit 4e5146b

Browse files
committed
Suppress occasional failure of final DROP DATABASE due to
race condition --- old backend may not have shut down by the time we try to do the DROP.
1 parent 55d5b58 commit 4e5146b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/interfaces/perl5/test.pl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/local/bin/perl -w
22

3-
# $Id: test.pl,v 1.12 2000/03/11 02:57:24 tgl Exp $
3+
# $Id: test.pl,v 1.13 2000/11/17 00:24:03 tgl Exp $
44

55
# Before `make install' is performed this script should be runnable with
66
# `make test'. After `make install' it should work as `perl test.pl'
@@ -260,6 +260,13 @@
260260
$conn = Pg::connectdb("dbname=$dbmain");
261261
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;
262262

263+
# Race condition: it's quite possible that the DROP command will arrive
264+
# at the new backend before the old backend has finished shutting down,
265+
# resulting in an error message.
266+
# There doesn't seem to be any more graceful way around this than to
267+
# insert a small delay ...
268+
sleep(1);
269+
263270
$result = $conn->exec("DROP DATABASE $dbname");
264271
die $conn->errorMessage unless PGRES_COMMAND_OK eq $result->resultStatus;
265272

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy