- Notifications
You must be signed in to change notification settings - Fork4.9k
Commite0f373e
committed
Re-enable SSL connect_fails tests, and fix related race conditions.
Cluster.pm's connect_fails routine has long had the ability tosniff the postmaster log file for expected messages after aconnection failure. However, that's always had a race condition:on some platforms it's possible for psql to exit and the testscript to slurp up the postmaster log before the backend processhas been able to write out its final log messages. Back incommit55828a6 we disabled a bunch of tests after discoveringthat, and the aim of this patch is to re-enable them.(The sibling function connect_ok doesn't seem to have a similarproblem, mainly because the messages we look for come out duringthe authentication handshake, so that if psql reports successfulconnection they should certainly have been emitted already.)The solution used here is borrowed from 002_connection_limits.pl'sconnect_fails_wait routine: set the server's log_min_messages settingto DEBUG2 so that the postmaster will log child-process exit, and thenwait till we see that log entry before checking for the messages weare actually interested in.If a TAP test uses connect_fails' log_like or log_unlike options, andforgets to set log_min_messages, those connect_fails calls will nowhang until timeout. Fixing up the existing callers shows that we hadseveral other TAP tests that were in theory vulnerable to the sameproblem. It's unclear whether the lack of failures is just luck, orlack of buildfarm coverage, or perhaps there is some obscure timingeffect that only manifests in SSL connections. In any case, thischange should in principle make those other call sites more robust.I'm not inclined to back-patch though, unless sometime we observean actual failure in one of them.Reported-by: Andrew Dunstan <andrew@dunslane.net>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/984fca80-85a8-4c6f-a5cc-bb860950b435@dunslane.net1 parentda83b1e commite0f373e
File tree
7 files changed
+53
-42
lines changed- src/test
- authentication/t
- kerberos/t
- ldap/t
- modules/oauth_validator/t
- perl/PostgreSQL/Test
- ssl/t
7 files changed
+53
-42
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
| 70 | + | |
69 | 71 |
| |
70 | 72 |
| |
71 | 73 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| 75 | + | |
| 76 | + | |
75 | 77 |
| |
76 | 78 |
| |
77 | 79 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
| 52 | + | |
51 | 53 |
| |
52 | 54 |
| |
53 | 55 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
| 51 | + | |
| 52 | + | |
51 | 53 |
| |
52 | 54 |
| |
53 | 55 |
| |
|
Lines changed: 16 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2618 | 2618 |
| |
2619 | 2619 |
| |
2620 | 2620 |
| |
2621 |
| - | |
| 2621 | + | |
| 2622 | + | |
2622 | 2623 |
| |
2623 | 2624 |
| |
2624 | 2625 |
| |
2625 | 2626 |
| |
2626 | 2627 |
| |
2627 |
| - | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
2628 | 2634 |
| |
2629 | 2635 |
| |
2630 | 2636 |
| |
| |||
2652 | 2658 |
| |
2653 | 2659 |
| |
2654 | 2660 |
| |
2655 |
| - | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
2656 | 2669 |
| |
2657 | 2670 |
| |
2658 | 2671 |
| |
|
Lines changed: 28 additions & 39 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
| 63 | + | |
| 64 | + | |
63 | 65 |
| |
64 | 66 |
| |
65 | 67 |
| |
| |||
807 | 809 |
| |
808 | 810 |
| |
809 | 811 |
| |
810 |
| - | |
811 |
| - | |
812 |
| - | |
813 |
| - | |
| 812 | + | |
| 813 | + | |
814 | 814 |
| |
815 | 815 |
| |
816 | 816 |
| |
817 | 817 |
| |
818 | 818 |
| |
819 | 819 |
| |
820 | 820 |
| |
821 |
| - | |
822 |
| - | |
823 |
| - | |
824 |
| - | |
825 |
| - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
826 | 825 |
| |
827 | 826 |
| |
828 | 827 |
| |
| |||
872 | 871 |
| |
873 | 872 |
| |
874 | 873 |
| |
875 |
| - | |
876 |
| - | |
877 |
| - | |
878 |
| - | |
879 |
| - | |
880 |
| - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
881 | 878 |
| |
882 | 879 |
| |
883 | 880 |
| |
884 | 881 |
| |
885 | 882 |
| |
886 | 883 |
| |
887 |
| - | |
888 |
| - | |
889 |
| - | |
890 |
| - | |
891 |
| - | |
892 |
| - | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
893 | 888 |
| |
894 | 889 |
| |
895 | 890 |
| |
| |||
904 | 899 |
| |
905 | 900 |
| |
906 | 901 |
| |
907 |
| - | |
908 |
| - | |
909 |
| - | |
910 |
| - | |
911 |
| - | |
912 |
| - | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
913 | 906 |
| |
914 | 907 |
| |
915 | 908 |
| |
| |||
923 | 916 |
| |
924 | 917 |
| |
925 | 918 |
| |
926 |
| - | |
927 |
| - | |
928 |
| - | |
929 |
| - | |
930 |
| - | |
931 |
| - | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
932 | 923 |
| |
933 | 924 |
| |
934 | 925 |
| |
935 | 926 |
| |
936 | 927 |
| |
937 | 928 |
| |
938 | 929 |
| |
939 |
| - | |
940 |
| - | |
941 |
| - | |
942 |
| - | |
943 |
| - | |
944 |
| - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
945 | 934 |
| |
946 | 935 |
|
0 commit comments
Comments
(0)