forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit56b39cc
Check for STATUS_DELETE_PENDING on Windows.
1. Update our open() wrapper to check for NT's STATUS_DELETE_PENDINGand translate it to Unix-like errors. This is done withRtlGetLastNtStatus(), which is dynamically loaded from ntdll. A newfile win32ntdll.c centralizes lookup of NT functions, in case we decideto add more in the future.2. Remove non-working code that was trying to do something similar forstat(), and just reuse the open() wrapper code. As a side effect,stat() also gains resilience against "sharing violation" errors.3. Since stat() is used very early in process startup, remove therequirement that the Win32 signal event has been created beforepgwin32_open_handle() is reached. Instead, teach pg_usleep() to fallback to a non-interruptible sleep if reached before the signal event isavailable.This could be back-patched, but for now it's in master only. Theproblem has apparently been with us for a long time and generated only afew complaints. Proposed patches trigger it more often, which led tothis investigation and fix.Reviewed-by: Andres Freund <andres@anarazel.de>Reviewed-by: Alexander Lakhin <exclusion@gmail.com>Reviewed-by: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>Discussion:https://postgr.es/m/CA%2BhUKGJz_pZTF9mckn6XgSv69%2BjGwdgLkxZ6b3NWGLBCVjqUZA%40mail.gmail.com(cherry picked from commite2f0f8e)Author: Thomas Munro <tmunro@postgresql.org>Author: Alexandra Wang <alexandra.wang.oss@gmail.com>1 parentb4363fc commit56b39cc
File tree
9 files changed
+179
-122
lines changed- src
- backend/port/win32
- include
- port
- port
- tools/msvc
9 files changed
+179
-122
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16638 | 16638 |
| |
16639 | 16639 |
| |
16640 | 16640 |
| |
| 16641 | + | |
| 16642 | + | |
| 16643 | + | |
| 16644 | + | |
| 16645 | + | |
| 16646 | + | |
16641 | 16647 |
| |
16642 | 16648 |
| |
16643 | 16649 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1879 | 1879 |
| |
1880 | 1880 |
| |
1881 | 1881 |
| |
| 1882 | + | |
1882 | 1883 |
| |
1883 | 1884 |
| |
1884 | 1885 |
| |
|
Lines changed: 11 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
55 |
| - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
56 | 66 |
| |
57 | 67 |
| |
58 | 68 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
280 | 280 |
| |
281 | 281 |
| |
282 | 282 |
| |
| 283 | + | |
283 | 284 |
| |
284 | 285 |
| |
285 | 286 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + |
Lines changed: 56 additions & 48 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
| 17 | + | |
16 | 18 |
| |
17 | 19 |
| |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
| |
21 | 23 |
| |
| 24 | + | |
| 25 | + | |
22 | 26 |
| |
23 | 27 |
| |
24 | 28 |
| |
25 | 29 |
| |
26 |
| - | |
27 | 30 |
| |
28 | 31 |
| |
29 | 32 |
| |
| |||
56 | 59 |
| |
57 | 60 |
| |
58 | 61 |
| |
59 |
| - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 |
| |
61 |
| - | |
62 |
| - | |
| 66 | + | |
| 67 | + | |
63 | 68 |
| |
64 |
| - | |
65 |
| - | |
| 69 | + | |
66 | 70 |
| |
67 | 71 |
| |
68 | 72 |
| |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 |
| |
70 | 77 |
| |
71 | 78 |
| |
72 | 79 |
| |
73 | 80 |
| |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 | 81 |
| |
92 | 82 |
| |
93 | 83 |
| |
| |||
102 | 92 |
| |
103 | 93 |
| |
104 | 94 |
| |
| 95 | + | |
105 | 96 |
| |
106 | 97 |
| |
107 | 98 |
| |
| |||
140 | 131 |
| |
141 | 132 |
| |
142 | 133 |
| |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
154 |
| - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
155 | 142 |
| |
156 |
| - | |
| 143 | + | |
| 144 | + | |
157 | 145 |
| |
158 |
| - | |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
169 | 150 |
| |
170 | 151 |
| |
171 | 152 |
| |
172 |
| - | |
| 153 | + | |
173 | 154 |
| |
174 | 155 |
| |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 |
| |
176 | 184 |
| |
177 | 185 |
| |
|
Lines changed: 69 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + |
Lines changed: 6 additions & 72 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
122 | 122 |
| |
123 |
| - | |
124 | 123 |
| |
125 | 124 |
| |
126 |
| - | |
127 | 125 |
| |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 |
| - | |
152 |
| - | |
153 |
| - | |
154 |
| - | |
155 |
| - | |
156 |
| - | |
157 |
| - | |
158 |
| - | |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 |
| - | |
176 |
| - | |
177 |
| - | |
178 |
| - | |
179 |
| - | |
180 |
| - | |
181 |
| - | |
182 |
| - | |
183 |
| - | |
184 |
| - | |
185 |
| - | |
186 |
| - | |
187 |
| - | |
188 |
| - | |
189 |
| - | |
190 |
| - | |
191 |
| - | |
| 126 | + | |
| 127 | + | |
192 | 128 |
| |
193 |
| - | |
194 | 129 |
| |
195 |
| - | |
196 | 130 |
| |
197 | 131 |
| |
198 | 132 |
| |
|
0 commit comments
Comments
(0)