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

Commitc289117

Browse files
committed
Try to fix pg_upgrade test on Windows, again.
Further to commit54e72b6, if rmtree() fails while cleaning up inpg_upgrade, try again. This gives our Windows unlink() wrapper a chanceto reach its wait-for-the-other-process-to-go-away logic, if the firstgo around initiated the unlink of a file that a concurrently exitingprogram still has open.Discussion:https://postgr.es/m/CA%2BhUKGKCVy2%3Do%3Dd8c2Va6a_3Rpf_KkhUitkWCZ3hzuO2VwLMXA%40mail.gmail.com
1 parent758f44b commitc289117

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎src/bin/pg_upgrade/util.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ cleanup_output_dirs(void)
6868
if (log_opts.retain)
6969
return;
7070

71-
(void)rmtree(log_opts.basedir, true);
71+
/*
72+
* Try twice. The second time might wait for files to finish being
73+
* unlinked, on Windows.
74+
*/
75+
if (!rmtree(log_opts.basedir, true))
76+
rmtree(log_opts.basedir, true);
7277

7378
/* Remove pg_upgrade_output.d only if empty */
7479
switch (pg_check_dir(log_opts.rootdir))
@@ -80,7 +85,13 @@ cleanup_output_dirs(void)
8085

8186
case1:/* exists and empty */
8287
case2:/* exists and contains only dot files */
83-
(void)rmtree(log_opts.rootdir, true);
88+
89+
/*
90+
* Try twice. The second time might wait for files to finish
91+
* being unlinked, on Windows.
92+
*/
93+
if (!rmtree(log_opts.rootdir, true))
94+
rmtree(log_opts.rootdir, true);
8495
break;
8596

8697
case4:/* exists */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp