Commit 6647248
committed
Don't allow immediate interrupts during authentication anymore.
We used to handle authentication_timeout by setting
ImmediateInterruptOK to true during large parts of the authentication
phase of a new connection. While that happens to work acceptably in
practice, it's not particularly nice and has ugly corner cases.
Previous commits converted the FE/BE communication to use latches and
implemented support for interrupt handling during both
send/recv. Building on top of that work we can get rid of
ImmediateInterruptOK during authentication, by immediately treating
timeouts during authentication as a reason to die. As die interrupts
are handled immediately during client communication that provides a
sensibly quick reaction time to authentication timeout.
Additionally add a few CHECK_FOR_INTERRUPTS() to some more complex
authentication methods. More could be added, but this already should
provides a reasonable coverage.
While it this overall increases the maximum time till a timeout is
reacted to, it greatly reduces complexity and increases
reliability. That seems like a overall win. If the increase proves to
be noticeable we can deal with those cases by moving to nonblocking
network code and add interrupt checking there.
Reviewed-By: Heikki Linnakangas1 parent cec916f commit 6647248
File tree
5 files changed
+41
-37
lines changed- src/backend
- libpq
- tcop
- utils/init
5 files changed
+41
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | 309 | | |
317 | 310 | | |
318 | 311 | | |
| |||
566 | 559 | | |
567 | 560 | | |
568 | 561 | | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | 562 | | |
573 | 563 | | |
574 | 564 | | |
| |||
580 | 570 | | |
581 | 571 | | |
582 | 572 | | |
| 573 | + | |
| 574 | + | |
583 | 575 | | |
584 | 576 | | |
585 | 577 | | |
| |||
613 | 605 | | |
614 | 606 | | |
615 | 607 | | |
| 608 | + | |
| 609 | + | |
616 | 610 | | |
617 | 611 | | |
618 | 612 | | |
| |||
851 | 845 | | |
852 | 846 | | |
853 | 847 | | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
854 | 851 | | |
855 | 852 | | |
856 | 853 | | |
| |||
900 | 897 | | |
901 | 898 | | |
902 | 899 | | |
| 900 | + | |
| 901 | + | |
903 | 902 | | |
904 | 903 | | |
905 | 904 | | |
| |||
1396 | 1395 | | |
1397 | 1396 | | |
1398 | 1397 | | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1399 | 1401 | | |
1400 | 1402 | | |
1401 | 1403 | | |
| |||
1510 | 1512 | | |
1511 | 1513 | | |
1512 | 1514 | | |
| 1515 | + | |
| 1516 | + | |
1513 | 1517 | | |
1514 | 1518 | | |
1515 | 1519 | | |
| |||
1525 | 1529 | | |
1526 | 1530 | | |
1527 | 1531 | | |
| 1532 | + | |
| 1533 | + | |
1528 | 1534 | | |
1529 | 1535 | | |
1530 | 1536 | | |
| |||
2413 | 2419 | | |
2414 | 2420 | | |
2415 | 2421 | | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
2416 | 2426 | | |
2417 | 2427 | | |
2418 | 2428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | 50 | | |
58 | 51 | | |
59 | 52 | | |
| |||
80 | 73 | | |
81 | 74 | | |
82 | 75 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 76 | | |
87 | 77 | | |
88 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2880 | 2880 | | |
2881 | 2881 | | |
2882 | 2882 | | |
2883 | | - | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
2884 | 2888 | | |
2885 | 2889 | | |
2886 | 2890 | | |
| |||
2959 | 2963 | | |
2960 | 2964 | | |
2961 | 2965 | | |
2962 | | - | |
2963 | | - | |
2964 | | - | |
2965 | | - | |
2966 | | - | |
2967 | | - | |
2968 | | - | |
2969 | | - | |
2970 | | - | |
2971 | | - | |
2972 | | - | |
2973 | 2966 | | |
2974 | 2967 | | |
2975 | 2968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1102 | 1111 | | |
1103 | 1112 | | |
1104 | | - | |
| 1113 | + | |
1105 | 1114 | | |
1106 | | - | |
| 1115 | + | |
1107 | 1116 | | |
1108 | 1117 | | |
1109 | 1118 | | |
1110 | 1119 | | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | 1120 | | |
1115 | 1121 | | |
1116 | 1122 | | |
| |||
0 commit comments