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

Commitc85ad9c

Browse files
committed
Allow ENOENT in check_mode_recursive().
Buildfarm member tern failed src/bin/pg_ctl/t/001_start_stop.pl when acheck_mode_recursive() call overlapped a server's startup-time deletionof pg_stat/global.stat. Just warn. Also, include errno in the message.Back-patch to v11, where check_mode_recursive() first appeared.
1 parent076a3c2 commitc85ad9c

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

‎src/test/perl/TestLib.pm

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,6 @@ sub check_mode_recursive
261261
{
262262
follow_fast=> 1,
263263
wanted=>sub {
264-
my$file_stat =stat($File::Find::name);
265-
266264
# Is file in the ignore list?
267265
foreachmy$ignore ($ignore_list ? @{$ignore_list} : [])
268266
{
@@ -272,8 +270,23 @@ sub check_mode_recursive
272270
}
273271
}
274272

275-
defined($file_stat)
276-
ordie("unable to stat$File::Find::name");
273+
# Allow ENOENT. A running server can delete files, such as
274+
# those in pg_stat. Other stat() failures are fatal.
275+
my$file_stat =stat($File::Find::name);
276+
unless (defined($file_stat))
277+
{
278+
my$is_ENOENT =$!{ENOENT};
279+
my$msg ="unable to stat$File::Find::name:$!";
280+
if ($is_ENOENT)
281+
{
282+
warn$msg;
283+
return;
284+
}
285+
else
286+
{
287+
die$msg;
288+
}
289+
}
277290

278291
my$file_mode = S_IMODE($file_stat->mode);
279292

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp