forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite109e43
committed
Fix unlink() for STATUS_DELETE_PENDING on Windows.
Commitf357233 assumed that it was OK to return ENOENT directly iflstat() failed that way. If we got STATUS_DELETE_PENDING while tryingto unlink a file that we had already unlinked successfully once beforebut someone else still had open (on a kernel version that has "pending"unlinks by default), then we would no longer reach the retry loop inpgunlink(). That loop claims to be only for handling sharing violations(a different phenomenon), but the errno is the same.Restore that behavior with an explicit check, to see if it fixes theoccasional 'directory not empty' failures seen in the pg_upgrade testson CI. Further improvements are possible with proposed upgrades tomodern Windows APIs that would replace this convoluted code.Reported-by: Justin Pryzby <pryzby@telsasoft.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/20220920013122.GA31833%40telsasoft.comDiscussion:https://postgr.es/m/CA%2BhUKG%2BajSQ_8eu2AogTncOnZ5me2D-Cn66iN_-wZnRjLN%2Bicg%40mail.gmail.com1 parent4517358 commite109e43
1 file changed
+36
-2
lines changedLines changed: 36 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 |
| |
43 | 47 |
| |
44 | 48 |
| |
| |||
91 | 95 |
| |
92 | 96 |
| |
93 | 97 |
| |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
94 | 114 |
| |
95 | 115 |
| |
96 | 116 |
| |
97 | 117 |
| |
98 | 118 |
| |
99 | 119 |
| |
100 | 120 |
| |
| 121 | + | |
101 | 122 |
| |
102 | 123 |
| |
103 | 124 |
| |
| |||
122 | 143 |
| |
123 | 144 |
| |
124 | 145 |
| |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
125 | 152 |
| |
126 | 153 |
| |
127 |
| - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
128 | 162 |
| |
129 | 163 |
| |
130 | 164 |
| |
| |||
133 | 167 |
| |
134 | 168 |
| |
135 | 169 |
| |
136 |
| - | |
| 170 | + | |
137 | 171 |
| |
138 | 172 |
| |
139 | 173 |
| |
|
0 commit comments
Comments
(0)