forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9dd4178
committed
Be more predictable about reporting "lock timeout" vs "statement timeout".
If both timeout indicators are set when we arrive at ProcessInterrupts,we've historically just reported "lock timeout". However, some buildfarmmembers have been observed to fail isolationtester's timeouts test byreporting "lock timeout" when the statement timeout was expected to firefirst. The cause seems to be that the process is allowed to sleep longerthan expected (probably due to heavy machine load) so that the locktimeout happens before we reach the point of reporting the error, andthen this arbitrary tiebreak rule does the wrong thing. We can improvematters by comparing the scheduled timeout times to decide which errorto report.I had originally proposed greatly reducing the 1-second window betweenthe two timeouts in the test cases. On reflection that is a bad idea,at least for the case where the lock timeout is expected to fire first,because that would assume that it takes negligible time to get fromstatement start to the beginning of the lock wait. Thus, this patchdoesn't completely remove the risk of test failures on slow machines.Empirically, however, the case this handles is the one we are seeingin the buildfarm. The explanation may be that the other case requiresthe scheduler to take the CPU away from a busy process, whereas thecase fixed here only requires the scheduler to not give the CPU backright away to a process that has been woken from a multi-second sleep(and, perhaps, has been swapped out meanwhile).Back-patch to 9.3 where the isolationtester timeouts test was added.Discussion: <8693.1464314819@sss.pgh.pa.us>1 parentd74048d commit9dd4178
File tree
3 files changed
+35
-5
lines changed- src
- backend
- tcop
- utils/misc
- include/utils
3 files changed
+35
-5
lines changedLines changed: 19 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2909 | 2909 |
| |
2910 | 2910 |
| |
2911 | 2911 |
| |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
2912 | 2915 |
| |
2913 | 2916 |
| |
2914 | 2917 |
| |
| |||
2929 | 2932 |
| |
2930 | 2933 |
| |
2931 | 2934 |
| |
2932 |
| - | |
| 2935 | + | |
2933 | 2936 |
| |
2934 |
| - | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
2935 | 2951 |
| |
2936 |
| - | |
2937 | 2952 |
| |
2938 | 2953 |
| |
2939 | 2954 |
| |
2940 | 2955 |
| |
2941 | 2956 |
| |
2942 |
| - | |
| 2957 | + | |
2943 | 2958 |
| |
2944 | 2959 |
| |
2945 | 2960 |
| |
|
Lines changed: 15 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| |||
654 | 654 |
| |
655 | 655 |
| |
656 | 656 |
| |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
| 85 | + | |
85 | 86 |
| |
86 | 87 |
|
0 commit comments
Comments
(0)