copy: apply Luna pass 1 to the backhaul_shed words and README
Strings changed after the pass to match the fixes are marked "adjusted after Luna pass 1" in ruletext.go and README.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed,
+53
−30
README.md+28 −16internal/alerting/ruletext.go+21 −13internal/console/alertpages_test.go+4 −1
diff --git a/README.md b/README.md| index 17ee95106..d0306276e 100644 |
| --- a/README.md |
| +++ b/README.md |
| @@ -1100,24 +1100,36 @@ forwards it to the box that does. This is the backhaul. Every forwarded |
| request crosses the network twice, so each sending box limits how many it has |
| open toward any one destination box at a time. It keeps two separate limits: |
| -- `CARLOS_BACKHAUL_MAX_INFLIGHT`: ordinary requests, 256 per destination box |
| +<!-- adjusted after Luna pass 1: the defaults (128 and 512) and the last |
| +two sentences of the second item. --> |
| +- `CARLOS_BACKHAUL_MAX_INFLIGHT`: ordinary requests, 128 per destination box |
| by default. |
| - `CARLOS_BACKHAUL_MAX_STREAMS`: WebSockets and other upgraded connections, |
| - 1024 per destination box by default. A socket keeps its place until it |
| + 512 per destination box by default. A socket keeps its place until it |
| closes, so sockets have a limit of their own and never use up the room |
| - ordinary requests need. |
| - |
| -Set either one in the sending box's `/etc/carlos/host.env` and restart |
| -`carlos-edge`. A value that is not a positive whole number is logged and the |
| -default is used. Neither limit can be turned off. |
| - |
| -At either limit the sending box answers `503` with `Retry-After: 2`, and its |
| -journal has a line that starts `backhaul to <box>` and names the destination |
| -box. While `CARLOS_RATE_LIMIT` is `enforce`, one visitor address may also hold |
| -at most 8 ordinary requests, or 64 sockets, once that limit is half used. More |
| -than that gets `429`. The `backhaul_shed` rule fires when a box refuses more |
| -than 10 forwarded requests in a minute, and clears after a minute with none |
| -(see [Fleet alerts](#fleet-alerts)). |
| + ordinary requests need. A request to open a socket counts as an ordinary |
| + request until the destination box accepts it. If the socket limit is |
| + reached at that moment, it gets `503` with `Retry-After: 2`. |
| + |
| +Set either one in the sending box's `/etc/carlos/host.env`, or as a |
| +`/carlos/<deployment>/<region>/` or `/shared/` parameter on a box launched by |
| +its region's group. Restart `carlos-edge` after changing `host.env`. A value |
| +that is not a positive whole number is logged and the default is used. |
| +Neither limit can be turned off. |
| + |
| +<!-- adjusted after Luna pass 1: the share sentence (a quarter of a lowered |
| +limit), and the rule's sentence (refusals at a limit only, three quiet |
| +minutes) with the one after it. --> |
| +When either limit is reached, the sending box returns `503` with |
| +`Retry-After: 2`, and its journal has a line that starts `backhaul to <box>` |
| +and names the destination box. While `CARLOS_RATE_LIMIT` is `enforce`, one |
| +visitor address may also hold at most 8 ordinary requests, or 64 sockets, |
| +once that limit is half used, or a quarter of the limit if that is fewer. More |
| +than that gets `429`. The `backhaul_shed` rule is a warning in the console's |
| +alert engine. The box does not page for it. It fires when a box refuses more |
| +than 10 forwarded requests in a minute because a limit was reached, and |
| +clears after three minutes with none (see [Fleet alerts](#fleet-alerts)). |
| +Refusals of a visitor over its share do not count toward it. |
| Server-sent events and long polls are ordinary requests here: they hold a |
| place under `CARLOS_BACKHAUL_MAX_INFLIGHT` for as long as they stay open. |
| @@ -1251,7 +1263,7 @@ with no usable connector appear as notes on that job, not as failures. |
| | `lag`, mail relay lag | box | warning | 900 seconds, fixed | |
| | `geoip`, location database | box | warning | fixed | |
| | `engine_silent` | the console box's agent | incident | no beat for 10 minutes, fixed (`CARLOS_ALERT_ENGINE_BEAT`) | |
| -| `backhaul_shed`, forwarded requests refused | box | warning | more than 10 in a minute, clears after a minute with none, fixed (see [Forwarding between boxes](#forwarding-between-boxes)) | |
| +| `backhaul_shed`, forwarded requests refused | box | warning (console only) | more than 10 refused at a limit in a minute, clears after three minutes with none, fixed (see [Forwarding between boxes](#forwarding-between-boxes)) <!-- adjusted after Luna pass 1: refused at a limit; three minutes --> | |
| | `box_silent` | console | incident | no heartbeat for 15 minutes, editable from 5 to 1440 | |
| | `service_down` | console | incident | a platform service the fleet summary reports down | |
| | `cert_expiring` | console | warning | a served host's certificate expires within 14 days, editable from 1 to 60 | |
diff --git a/internal/alerting/ruletext.go b/internal/alerting/ruletext.go| index d7a429a79..b87829af8 100644 |
| --- a/internal/alerting/ruletext.go |
| +++ b/internal/alerting/ruletext.go |
| @@ -94,24 +94,32 @@ var BoxRuleText = map[string]RuleText{ |
| } |
| // The backhaul_shed rule's words (#1535), every one in this block: a box |
| -// refused requests it was forwarding to the box that hosts their app |
| -// (the backhaul), because that box had too many in flight from it, or one |
| -// visitor held too many. The console's messages and Rules page read the |
| -// rest of them from here too. Not yet copy reviewed. |
| +// refused requests it was forwarding to the box that hosts their app (the |
| +// backhaul) because its limit toward that box was reached. The console's |
| +// messages and Rules page read the rest of them from here too. Luna pass 1 |
| +// applied; the lines marked "adjusted after Luna pass 1" changed after it. |
| const ( |
| - BackhaulShedTitle = "Forwarded requests refused" |
| - BackhaulShedHowLong = "Visitors are already getting errors, and keep getting them while the limit is reached." |
| - BackhaulShedWhatToDo = "Read the box's journal for backhaul lines to see which box was full and why. If real traffic needs more room, raise CARLOS_BACKHAUL_MAX_INFLIGHT or CARLOS_BACKHAUL_MAX_STREAMS in its host.env." |
| + BackhaulShedTitle = "Forwarded requests refused" |
| + BackhaulShedHowLong = "Forwarded requests are being refused while the limit is reached. This is a warning in the console's alert engine. The box does not page for it." |
| + // adjusted after Luna pass 1: Luna's backticks around the journal |
| + // prefix, host.env and the parameter paths are quotes or plain text |
| + // here, because an alert message is plain text. |
| + BackhaulShedWhatToDo = "Read the box's journal for \"backhaul to\" lines. They show which destination box was limiting traffic and why. If traffic needs more room, raise the relevant limit in host.env, or set it as a /carlos/<deployment>/<region>/ or /shared/ parameter on a box launched by its region's group." |
| // BackhaulShedWhat and BackhaulShedWhatNone open a message; %s is |
| // the box. |
| - BackhaulShedWhat = "%s refused requests it was forwarding to another box." |
| - BackhaulShedWhatNone = "A box refused requests it was forwarding to another box." |
| + BackhaulShedWhat = "%s refused forwarded requests." |
| + BackhaulShedWhatNone = "A box refused forwarded requests." |
| // BackhaulShedWhen and BackhaulShedThreshold are the Rules page's |
| - // lines. The number is metrics.DefaultRules().BackhaulShedCount. |
| - BackhaulShedWhen = "A box refuses more than 10 requests in a minute that it was forwarding to another box." |
| - BackhaulShedThreshold = "Fixed at more than 10 in a minute. Clears after a minute with none. Not configurable." |
| + // lines. The numbers are metrics.DefaultRules()'s BackhaulShedCount |
| + // and BackhaulShedQuiet. Only refusals at a limit count, not a |
| + // visitor's fair-share refusals. |
| + // adjusted after Luna pass 1: says the refusals are at the limit. |
| + BackhaulShedWhen = "A box refuses more than 10 forwarded requests in a minute because its limit for the destination box is reached." |
| + // adjusted after Luna pass 1: refusals at the limit; clears after |
| + // three minutes, not one. |
| + BackhaulShedThreshold = "Fixed at more than 10 forwarded requests refused at the limit in a minute. Clears after three minutes with none. Not configurable." |
| // BackhaulShedValue is the last reading; %d is the count. |
| - BackhaulShedValue = "%d refused in a minute" |
| + BackhaulShedValue = "%d forwarded requests refused in a minute" |
| ) |
| // VerifyReason is one reason code a restore test's verdict carries |
diff --git a/internal/console/alertpages_test.go b/internal/console/alertpages_test.go| index 74d0554eb..9ef7e2149 100644 |
| --- a/internal/console/alertpages_test.go |
| +++ b/internal/console/alertpages_test.go |
| @@ -967,10 +967,13 @@ func TestAlertRuleBackhaulShed(t *testing.T) { |
| if n := metrics.DefaultRules().BackhaulShedCount; !strings.Contains(alerting.BackhaulShedWhen, "more than 10 ") || n != 10 { |
| t.Fatalf("the page says more than 10, the box fires above %v", n) |
| } |
| + if q := metrics.DefaultRules().BackhaulShedQuiet; !strings.Contains(alerting.BackhaulShedThreshold, "three minutes") || q != 3*time.Minute { |
| + t.Fatalf("the page says three minutes, the box clears after %v", q) |
| + } |
| if got := alertRuleTitle(rule); got != alerting.BackhaulShedTitle { |
| t.Fatalf("title = %q", got) |
| } |
| - if got := alertValueText(rule, 37); got != "37 refused in a minute" { |
| + if got := alertValueText(rule, 37); got != "37 forwarded requests refused in a minute" { |
| t.Fatalf("value = %q", got) |
| } |
| if !alertValued[rule] { |