Commit bb86141
committed
Kill dead-end children when there's nothing else left
Previously, the postmaster would never try to kill dead-end child
processes, even if there were no other processes left. A dead-end
backend will eventually exit, when authentication_timeout expires, but
if a dead-end backend is the only thing that's preventing the server
from shutting down, it seems better to kill it immediately. It's
particularly important, if there was a bug in the early startup code
that prevented a dead-end child from timing out and exiting normally.
Includes a test for that case where a dead-end backend previously
prevented the server from shutting down.
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/a102f15f-eac4-4ff2-af02-f9ff209ec66f@iki.fi1 parent 18d67a8 commit bb86141
File tree
4 files changed
+116
-10
lines changed- src
- backend/postmaster
- test
- perl/PostgreSQL/Test
- postmaster
- t
4 files changed
+116
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2985 | 2985 | | |
2986 | 2986 | | |
2987 | 2987 | | |
2988 | | - | |
2989 | | - | |
| 2988 | + | |
2990 | 2989 | | |
2991 | 2990 | | |
| 2991 | + | |
| 2992 | + | |
2992 | 2993 | | |
2993 | 2994 | | |
2994 | 2995 | | |
| |||
3027 | 3028 | | |
3028 | 3029 | | |
3029 | 3030 | | |
| 3031 | + | |
3030 | 3032 | | |
3031 | 3033 | | |
3032 | | - | |
| 3034 | + | |
3033 | 3035 | | |
3034 | 3036 | | |
3035 | 3037 | | |
| |||
3048 | 3050 | | |
3049 | 3051 | | |
3050 | 3052 | | |
| 3053 | + | |
| 3054 | + | |
3051 | 3055 | | |
3052 | 3056 | | |
3053 | 3057 | | |
3054 | 3058 | | |
3055 | 3059 | | |
3056 | | - | |
3057 | | - | |
3058 | | - | |
3059 | 3060 | | |
3060 | 3061 | | |
3061 | 3062 | | |
| |||
3381 | 3382 | | |
3382 | 3383 | | |
3383 | 3384 | | |
3384 | | - | |
| 3385 | + | |
3385 | 3386 | | |
3386 | 3387 | | |
3387 | 3388 | | |
3388 | 3389 | | |
3389 | | - | |
| 3390 | + | |
3390 | 3391 | | |
3391 | 3392 | | |
3392 | 3393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1194 | 1194 | | |
1195 | 1195 | | |
1196 | 1196 | | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1197 | 1200 | | |
1198 | 1201 | | |
1199 | 1202 | | |
| |||
1209 | 1212 | | |
1210 | 1213 | | |
1211 | 1214 | | |
1212 | | - | |
1213 | | - | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1214 | 1220 | | |
1215 | 1221 | | |
1216 | 1222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
0 commit comments