Commit 630edad
authored
fix(e2e/discovery): Let a crash-looping fixture fail instead of restarting forever (#54350)
### What does this PR do?
Stops the fixture services restarting forever when they are broken, so a fixture that cannot start reports itself as a failed unit.
The units set `StartLimitIntervalSec=0`, which disables systemd's start rate limit entirely. Combined with `Restart=always` and `RestartSec=1`, a service that fails immediately restarts forever: it stays in `activating (auto-restart)` and never reaches `failed`.
This PR enables the limit (`StartLimitIntervalSec=60`, `StartLimitBurst=5`) so a service that keeps failing gives up and the unit ends in `failed`.
### Motivation
DSCVR-621. There are some cases were discovery is failing but in some cases we can't clearly distinguish discovery really failing from the server just not starting up so make the service startup fail explicitly.
### Describe how you validated your changes
In a container running systemd 249 (the same version as the test image), with a service that exits after 450ms to match the observed rails failure:
| `[Unit]` config | State after 25s | `NRestarts` |
|---|---|---|
| `StartLimitIntervalSec=0` (before) | `activating (auto-restart)` | **16, still climbing** |
| `StartLimitIntervalSec=60` + `StartLimitBurst=5` (after) | **`failed`** (`Result: exit-code`) | 5 |
### Additional Notes
One deliberate trade-off: a fixture that currently succeeds only after more than five automatic restarts would now fail instead. That is right outcome — a fixture needing six attempts is broken and should say so.
Co-authored-by: vincent.whitchurch <vincent.whitchurch@datadoghq.com>1 parent b13ab21 commit 630edad
1 file changed
Lines changed: 10 additions & 1 deletion
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
40 | | - | |
| 48 | + | |
| 49 | + | |
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| |||
0 commit comments