Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e5146b

Browse files
committed
Suppress occasional failure of final DROP DATABASE due to
race condition --- old backend may not have shut down by the time wetry to do the DROP.
1 parent55d5b58 commit4e5146b

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->errorMessageunless PGRES_CONNECTION_OKeq$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->errorMessageunless PGRES_COMMAND_OKeq$result->resultStatus;
265272

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp