forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit50c67c2
committed
Use ResourceOwner to track WaitEventSets.
A WaitEventSet holds file descriptors or event handles (on Windows).If FreeWaitEventSet is not called, those fds or handles are leaked.Use ResourceOwners to track WaitEventSets, to clean those upautomatically on error.This was a live bug in async Append nodes, if a FDW'sForeignAsyncRequest function failed. (In back branches, I will apply amore localized fix for that based on PG_TRY-PG_FINALLY.)The added test doesn't check for leaking resources, so it passed evenbefore this commit. But at least it covers the code path.In the passing, fix misleading comment on what the 'nevents' argumentto WaitEventSetWait means.Report by Alexander Lakhin, analysis and suggestion for the fix byTom Lane. Fixes bug #17828.Reviewed-by: Alexander Lakhin, Thomas MunroDiscussion:https://www.postgresql.org/message-id/472235.1678387869@sss.pgh.pa.us1 parent414e755 commit50c67c2
File tree
9 files changed
+84
-13
lines changed- contrib/postgres_fdw
- expected
- sql
- src
- backend
- executor
- libpq
- postmaster
- storage/ipc
- include
- storage
- utils
9 files changed
+84
-13
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10809 | 10809 |
| |
10810 | 10810 |
| |
10811 | 10811 |
| |
| 10812 | + | |
| 10813 | + | |
| 10814 | + | |
| 10815 | + | |
| 10816 | + | |
| 10817 | + | |
| 10818 | + | |
10812 | 10819 |
| |
10813 | 10820 |
| |
10814 | 10821 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3607 | 3607 |
| |
3608 | 3608 |
| |
3609 | 3609 |
| |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
3610 | 3616 |
| |
3611 | 3617 |
| |
3612 | 3618 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1025 | 1025 |
| |
1026 | 1026 |
| |
1027 | 1027 |
| |
1028 |
| - | |
| 1028 | + | |
| 1029 | + | |
1029 | 1030 |
| |
1030 | 1031 |
| |
1031 | 1032 |
| |
| |||
1050 | 1051 |
| |
1051 | 1052 |
| |
1052 | 1053 |
| |
1053 |
| - | |
| 1054 | + | |
1054 | 1055 |
| |
1055 | 1056 |
| |
1056 | 1057 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
210 |
| - | |
| 210 | + | |
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1695 | 1695 |
| |
1696 | 1696 |
| |
1697 | 1697 |
| |
1698 |
| - | |
| 1698 | + | |
1699 | 1699 |
| |
1700 | 1700 |
| |
1701 | 1701 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
311 | 311 |
| |
312 | 312 |
| |
313 | 313 |
| |
314 |
| - | |
| 314 | + | |
315 | 315 |
| |
316 | 316 |
| |
317 | 317 |
| |
|
Lines changed: 61 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
| 65 | + | |
65 | 66 |
| |
66 | 67 |
| |
67 | 68 |
| |
| |||
101 | 102 |
| |
102 | 103 |
| |
103 | 104 |
| |
| 105 | + | |
| 106 | + | |
104 | 107 |
| |
105 | 108 |
| |
106 | 109 |
| |
| |||
195 | 198 |
| |
196 | 199 |
| |
197 | 200 |
| |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
198 | 226 |
| |
199 | 227 |
| |
200 | 228 |
| |
| |||
323 | 351 |
| |
324 | 352 |
| |
325 | 353 |
| |
326 |
| - | |
| 354 | + | |
327 | 355 |
| |
328 | 356 |
| |
329 | 357 |
| |
| |||
541 | 569 |
| |
542 | 570 |
| |
543 | 571 |
| |
544 |
| - | |
| 572 | + | |
545 | 573 |
| |
546 | 574 |
| |
547 | 575 |
| |
| |||
716 | 744 |
| |
717 | 745 |
| |
718 | 746 |
| |
| 747 | + | |
| 748 | + | |
| 749 | + | |
719 | 750 |
| |
720 | 751 |
| |
721 |
| - | |
| 752 | + | |
722 | 753 |
| |
723 | 754 |
| |
724 | 755 |
| |
| |||
744 | 775 |
| |
745 | 776 |
| |
746 | 777 |
| |
747 |
| - | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
748 | 782 |
| |
749 | 783 |
| |
750 | 784 |
| |
| |||
770 | 804 |
| |
771 | 805 |
| |
772 | 806 |
| |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
773 | 813 |
| |
774 | 814 |
| |
775 | 815 |
| |
| |||
834 | 874 |
| |
835 | 875 |
| |
836 | 876 |
| |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
837 | 883 |
| |
838 | 884 |
| |
839 | 885 |
| |
840 | 886 |
| |
841 | 887 |
| |
842 | 888 |
| |
843 | 889 |
| |
844 |
| - | |
845 |
| - | |
846 |
| - | |
| 890 | + | |
847 | 891 |
| |
848 | 892 |
| |
849 | 893 |
| |
| |||
2300 | 2344 |
| |
2301 | 2345 |
| |
2302 | 2346 |
| |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + |
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
| 105 | + | |
| 106 | + | |
105 | 107 |
| |
106 | 108 |
| |
107 | 109 |
| |
| |||
173 | 175 |
| |
174 | 176 |
| |
175 | 177 |
| |
176 |
| - | |
| 178 | + | |
177 | 179 |
| |
178 | 180 |
| |
179 | 181 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
77 | 78 |
| |
78 | 79 |
| |
79 | 80 |
| |
|
0 commit comments
Comments
(0)