forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit54e72b6
committed
Refactor rmtree() to use get_dirent_type().
Switch to get_dirent_type() instead of lstat() while traversing adirectory tree, to see if that fixes the intermittent ENOTEMPTY failuresseen in recent pg_upgrade tests, on Windows CI. While refactoring, alsouse AllocateDir() instead of opendir() in the backend, which knows howto handle descriptor pressure.Our CI system currently uses Windows Server 2019, a version known not tohave POSIX unlink semantics enabled by default yet, unlike typicalWindows 10 and 11 systems. That might explain why we see this flappingon CI but (apparently) not in the build farm, though the frequency isquite low.The theory is that some directory entry must be in stateSTATUS_DELETE_PENDING, which lstat() would report as ENOENT, thoughunfortunately we don't know exactly why yet. With this change, rmtree()will not skip them, and try to unlink (again). Our unlink() wrappershould either wait a short time for them to go away when some otherprocess closes the handle, or log a message to tell us the path of theproblem file if not, so we can dig further.Discussion:https://postgr.es/m/20220919213217.ptqfdlcc5idk5xup%40awork3.anarazel.de1 parent3bef56e commit54e72b6
1 file changed
+64
-56
lines changedLines changed: 64 additions & 56 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
| 24 | + | |
23 | 25 |
| |
| 26 | + | |
24 | 27 |
| |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 |
| |
26 | 32 |
| |
| 33 | + | |
| 34 | + | |
| 35 | + | |
27 | 36 |
| |
28 | 37 |
| |
29 |
| - | |
30 | 38 |
| |
31 | 39 |
| |
32 | 40 |
| |
| |||
41 | 49 |
| |
42 | 50 |
| |
43 | 51 |
| |
44 |
| - | |
45 | 52 |
| |
46 |
| - | |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 |
| |
56 |
| - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 |
| |
| 65 | + | |
58 | 66 |
| |
59 |
| - | |
60 |
| - | |
| 67 | + | |
61 | 68 |
| |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
| 69 | + | |
| 70 | + | |
83 | 71 |
| |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
| 72 | + | |
| 73 | + | |
96 | 74 |
| |
97 |
| - | |
98 |
| - | |
99 |
| - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
100 | 94 |
| |
101 |
| - | |
102 |
| - | |
| 95 | + | |
103 | 96 |
| |
104 | 97 |
| |
105 |
| - | |
| 98 | + | |
106 | 99 |
| |
107 | 100 |
| |
108 | 101 |
| |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
109 | 118 |
| |
110 | 119 |
| |
111 | 120 |
| |
112 | 121 |
| |
113 |
| - | |
114 |
| - | |
| 122 | + | |
115 | 123 |
| |
116 | 124 |
| |
117 | 125 |
| |
118 | 126 |
| |
119 |
| - | |
| 127 | + | |
120 | 128 |
| |
121 | 129 |
| |
122 | 130 |
|
0 commit comments
Comments
(0)