Commit 3b14587
committed
fix delayed shutdown for non-smtp delivery handlers
Occasionally we'll have someone report that systemd timed out
and sigkill'd their kumo on shutdown.
One possible scenario for this is a lua delivery handler that
is taking too long, presumably because the other end of it
(eg: webhook or other custom endpoint) is not responding in
a timely fashion.
The way that we handle shutdown is that we compute a maximum
theoretical timeout value by summing up all of the smtp client
timeout values. Some of those can be several minutes in
duration because the are using default values derived from
a very conservative set of values suggested by the SMTP
RFCs from the '70s.
Those obviously should not apply to a custom delivery handler,
but also, in the context of an established SMTP session, we
should not add in the connection-establishment-specific values
when we're just waiting for a per-message send.
This commit addresses this situation on two fronts:
* Introduce a new system_shutdown_timeout value that allows the
user to conveniently express their desired timeout value
in a single option. This is *not* set by default!
* The default value for system_shutdown_timeout is computed by
summing the per-message-delivery smtp timeout options, which
is a much more reasonable, and more importantly, shorter than
our 300s TimeoutStopSec value in kumomta.service1 parent 7d3869d commit 3b14587
7 files changed
Lines changed: 63 additions & 5 deletions
File tree
- assets/policy-extras
- crates
- kumo-api-types/src
- kumod/src
- rfc5321/src
- docs
- changelog
- reference/kumo/make_egress_path
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
218 | 224 | | |
219 | 225 | | |
220 | 226 | | |
| |||
342 | 348 | | |
343 | 349 | | |
344 | 350 | | |
| 351 | + | |
345 | 352 | | |
346 | 353 | | |
347 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1948 | 1948 | | |
1949 | 1949 | | |
1950 | 1950 | | |
| 1951 | + | |
1951 | 1952 | | |
1952 | 1953 | | |
1953 | 1954 | | |
| |||
2092 | 2093 | | |
2093 | 2094 | | |
2094 | 2095 | | |
| 2096 | + | |
2095 | 2097 | | |
2096 | 2098 | | |
2097 | 2099 | | |
| |||
2153 | 2155 | | |
2154 | 2156 | | |
2155 | 2157 | | |
| 2158 | + | |
2156 | 2159 | | |
2157 | 2160 | | |
2158 | 2161 | | |
| |||
2299 | 2302 | | |
2300 | 2303 | | |
2301 | 2304 | | |
| 2305 | + | |
2302 | 2306 | | |
2303 | 2307 | | |
2304 | 2308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
575 | 579 | | |
576 | 580 | | |
577 | 581 | | |
| |||
918 | 922 | | |
919 | 923 | | |
920 | 924 | | |
921 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
922 | 928 | | |
923 | 929 | | |
924 | 930 | | |
| |||
1931 | 1937 | | |
1932 | 1938 | | |
1933 | 1939 | | |
1934 | | - | |
| 1940 | + | |
1935 | 1941 | | |
1936 | 1942 | | |
1937 | 1943 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
154 | 164 | | |
155 | 165 | | |
156 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
Lines changed: 22 additions & 0 deletions
| 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 | + | |
0 commit comments