forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfe27009
committed
Recognize network-failure errnos as indicating hard connection loss.
Up to now, only ECONNRESET (and EPIPE, in most but not quite all places)received special treatment in our error handling logic. This patchchanges things so that related error codes such as ECONNABORTED arealso recognized as indicating that the connection's dead and unlikelyto come back.We continue to think, however, that only ECONNRESET and EPIPE should bereported as probable server crashes; the other cases indicate networkconnectivity problems but prove little about the server's state. Thus,there's no change in the error message texts that are output for suchcases. The key practical effect is that errcode_for_socket_access()will report ERRCODE_CONNECTION_FAILURE rather thanERRCODE_INTERNAL_ERROR for a network failure. It's expected that thiswill fix buildfarm member lorikeet's failures since commit32a9c0b,as that seems to be due to not treating ECONNABORTED equivalently toECONNRESET.The set of errnos treated this way now includes ECONNABORTED, EHOSTDOWN,EHOSTUNREACH, ENETDOWN, ENETRESET, and ENETUNREACH. Several of thesewere second-class citizens in terms of their handling in places likeget_errno_symbol(), so upgrade the infrastructure where necessary.As committed, this patch assumes that all these symbols are definedeverywhere. POSIX specifies all of them except EHOSTDOWN, but thatseems to exist on all platforms of interest; we'll see what thebuildfarm says about that.Probably this should be back-patched, but let's see what the buildfarmthinks of it first.Fujii Masao and Tom LaneDiscussion:https://postgr.es/m/2621622.1602184554@sss.pgh.pa.us1 parented30b1a commitfe27009
File tree
9 files changed
+96
-58
lines changed- src
- backend
- port/win32
- utils/error
- bin/pg_dump
- include
- port
- interfaces/libpq
- port
9 files changed
+96
-58
lines changedLines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
120 | 120 |
| |
121 | 121 |
| |
122 | 122 |
| |
123 |
| - | |
124 | 123 |
| |
| 124 | + | |
| 125 | + | |
| 126 | + | |
125 | 127 |
| |
| 128 | + | |
| 129 | + | |
126 | 130 |
| |
| 131 | + | |
| 132 | + | |
127 | 133 |
| |
| 134 | + | |
| 135 | + | |
128 | 136 |
| |
129 |
| - | |
| 137 | + | |
130 | 138 |
| |
131 | 139 |
| |
132 | 140 |
| |
|
Lines changed: 1 addition & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
711 | 711 |
| |
712 | 712 |
| |
713 | 713 |
| |
714 |
| - | |
715 |
| - | |
716 |
| - | |
717 |
| - | |
| 714 | + | |
718 | 715 |
| |
719 | 716 |
| |
720 | 717 |
| |
|
Lines changed: 8 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1825 | 1825 |
| |
1826 | 1826 |
| |
1827 | 1827 |
| |
1828 |
| - | |
| 1828 | + | |
1829 | 1829 |
| |
1830 |
| - | |
1831 |
| - | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
1832 | 1837 |
| |
1833 | 1838 |
| |
1834 | 1839 |
| |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
102 | 124 |
| |
103 | 125 |
| |
104 | 126 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
369 | 369 |
| |
370 | 370 |
| |
371 | 371 |
| |
| 372 | + | |
| 373 | + | |
372 | 374 |
| |
373 | 375 |
| |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
374 | 382 |
| |
375 | 383 |
| |
376 | 384 |
| |
|
Lines changed: 38 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
668 | 668 |
| |
669 | 669 |
| |
670 | 670 |
| |
671 |
| - | |
672 |
| - | |
673 |
| - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
674 | 677 |
| |
675 |
| - | |
676 |
| - | |
| 678 | + | |
| 679 | + | |
677 | 680 |
| |
678 | 681 |
| |
679 |
| - | |
680 |
| - | |
| 682 | + | |
| 683 | + | |
681 | 684 |
| |
682 |
| - | |
683 |
| - | |
684 |
| - | |
685 |
| - | |
686 |
| - | |
687 |
| - | |
688 |
| - | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
689 | 694 |
| |
690 | 695 |
| |
691 | 696 |
| |
| |||
758 | 763 |
| |
759 | 764 |
| |
760 | 765 |
| |
761 |
| - | |
762 |
| - | |
763 |
| - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
764 | 772 |
| |
765 |
| - | |
766 |
| - | |
| 773 | + | |
| 774 | + | |
767 | 775 |
| |
768 | 776 |
| |
769 |
| - | |
770 |
| - | |
| 777 | + | |
| 778 | + | |
771 | 779 |
| |
772 |
| - | |
773 |
| - | |
774 |
| - | |
775 |
| - | |
776 |
| - | |
777 |
| - | |
778 |
| - | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
779 | 789 |
| |
780 | 790 |
| |
781 | 791 |
| |
|
Lines changed: 1 addition & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
261 | 261 |
| |
262 | 262 |
| |
263 | 263 |
| |
264 |
| - | |
| 264 | + | |
265 | 265 |
| |
266 | 266 |
| |
267 | 267 |
| |
268 | 268 |
| |
269 | 269 |
| |
270 | 270 |
| |
271 |
| - | |
272 | 271 |
| |
273 | 272 |
| |
274 | 273 |
| |
| |||
374 | 373 |
| |
375 | 374 |
| |
376 | 375 |
| |
377 |
| - | |
378 | 376 |
| |
379 | 377 |
| |
380 | 378 |
| |
381 |
| - | |
382 | 379 |
| |
383 | 380 |
| |
384 | 381 |
| |
|
Lines changed: 0 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
18 |
| - | |
19 |
| - | |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 | 17 |
| |
29 | 18 |
| |
30 | 19 |
| |
|
Lines changed: 8 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
146 | 146 |
| |
147 | 147 |
| |
148 | 148 |
| |
149 |
| - | |
150 | 149 |
| |
151 | 150 |
| |
152 |
| - | |
153 | 151 |
| |
154 | 152 |
| |
155 |
| - | |
156 | 153 |
| |
157 | 154 |
| |
158 |
| - | |
159 | 155 |
| |
160 | 156 |
| |
161 | 157 |
| |
| |||
166 | 162 |
| |
167 | 163 |
| |
168 | 164 |
| |
169 |
| - | |
| 165 | + | |
| 166 | + | |
170 | 167 |
| |
171 | 168 |
| |
172 |
| - | |
173 | 169 |
| |
174 | 170 |
| |
175 | 171 |
| |
| |||
198 | 194 |
| |
199 | 195 |
| |
200 | 196 |
| |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
201 | 203 |
| |
202 | 204 |
| |
203 | 205 |
| |
|
0 commit comments
Comments
(0)