Skip to content

docs: fix retry-category test in the custom RetryPolicy sample - #3265

Merged
mgravell merged 1 commit into
mainfrom
marc/failover-docs-category-mask
Oct 8, 2026
Merged

mgravell merged 1 commit into
mainfrom
marc/failover-docs-category-mask

Conversation

@mgravell

@mgravell mgravell commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

The ReadOnlyOnlyRetryPolicy sample under "Custom Retry Policies" in docs/Failover.md tests the command's retry category with:

(fault.Flags & CommandFlags.CommandRetryReadOnly) != 0

The retry category is a 5-bit numeric field inside CommandFlags (CommandRetryNever = 31 << 13 spans it), not a set of independent bits. CommandRetryReadOnly is 8 << 13, and that bit is also set in CommandRetryWriteChecked (12), CommandRetryServerAdmin (24) and CommandRetryNever (31). Read literally, the sample would retry checked writes, server admin commands and commands explicitly marked never-retry, while correctly excluding last-wins and accumulating writes.

This PR changes the sample to mask the whole field and compare, matching what the library does internally:

var category = fault.Flags & CommandFlags.CommandRetryNever;
if (... && category != 0 && category <= CommandFlags.CommandRetryReadOnly)

Docs only, no code change.

Possible follow-up (not in this PR): FaultContext exposes Flags but no category accessor, so every custom policy has to know the masking trick. A public helper (e.g. FaultContext.RetryCategory, or an extension on CommandFlags) would remove the footgun; Message.GetRetryCategory already exists internally.

The ReadOnlyOnlyRetryPolicy sample in Failover.md tested the category with
(fault.Flags & CommandFlags.CommandRetryReadOnly) != 0. The retry category
is a 5-bit numeric field (CommandRetryNever spans it), not independent bits,
so that test is also true for CommandRetryWriteChecked, CommandRetryServerAdmin
and CommandRetryNever. Mask the whole field and compare instead.
@mgravell
mgravell merged commit 0eccaeb into main Oct 8, 2026
6 checks passed
@mgravell
mgravell deleted the marc/failover-docs-category-mask branch October 8, 2026 11:17
mgravell added a commit that referenced this pull request Oct 8, 2026
…ER010 (#3248), RetryPolicy doc fix (#3265)

Conflicts, resolved in v4 terms:

- Directory.Build.props: main retired SER010 from NoWarn; v4 had retired SER013 and still
  suppresses SER012 and SER014. NoWarn is v4's list without SER010, and the comment names all
  eight retired IDs (SER011 stays deliberately unsuppressed).
- src/RESPite/Shared/Experiments.cs: both retirements recorded - main's SER010 line
  (MaintenanceNotifications) and v4's SER013 note, whose renumbering explanation now says SER010
  has since retired too. The MaintenanceNotifications constant goes, as on main; nothing in v4's own
  code used it.
- src/StackExchange.Redis/PublicAPI/PublicAPI.Unshipped.txt: union of both sides (main's three
  provider overrides return to Unshipped), then eng/public-api.py sorted it - and RESPite's
  Unshipped file, which was already out of order on v4.

Everything else merged cleanly. Build clean with analyzers on every TFM; RESPite tests pass; main
suite net10.0 and net8.0 pass apart from known flakes, plus one unreproduced
QueuedResultTests failure noted in the ledger's watch list.
FloatingMilkshake pushed a commit to FloatingMilkshake/MechanicalMilkshake that referenced this pull request Oct 9, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [StackExchange.Redis](https://seredis.dev/) ([source](https://github.com/StackExchange/StackExchange.Redis)) | nuget | minor | `3.3.1` → `3.4.0` |

---

### Release Notes

<details>
<summary>StackExchange/StackExchange.Redis (StackExchange.Redis)</summary>

### [`v3.4.0`](https://github.com/StackExchange/StackExchange.Redis/releases/tag/3.4.0)

[Compare Source](StackExchange/StackExchange.Redis@3.3.1...3.4.0)

#### Major Changes

- In RESP3, by default the library now uses **separate** connections for pub/sub; see [#&#8203;3264](StackExchange/StackExchange.Redis#3264)
- Smart-client-handoffs is now enabled by default on Redis Enterprise and AMR; see [#&#8203;3248](StackExchange/StackExchange.Redis#3248)
- Some logging events incorrectly used duplicated ids - resolved; see [#&#8203;3266](StackExchange/StackExchange.Redis#3266)

#### All Changes

- Recover promptly from a cluster failover; fix the configuration channel under RESP3 and with a channel prefix ([#&#8203;3254](StackExchange/StackExchange.Redis#3254)) by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3255](StackExchange/StackExchange.Redis#3255)
- Preserve binary members as VectorSetRange bounds by [@&#8203;Laurianti](https://github.com/Laurianti) in [#&#8203;3256](StackExchange/StackExchange.Redis#3256)
- Smart client handoffs: reinstate auto-enlistment for the hosted providers and remove \[Experimental] by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3248](StackExchange/StackExchange.Redis#3248)
- docs: fix retry-category test in the custom RetryPolicy sample by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3265](StackExchange/StackExchange.Redis#3265)
- Fix duplicate LoggerMessage event ids; add a guard test by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3266](StackExchange/StackExchange.Redis#3266)
- Scan: observe the faults of abandoned page tasks after a sync timeout or dispose ([#&#8203;3260](StackExchange/StackExchange.Redis#3260)) by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3267](StackExchange/StackExchange.Redis#3267)
- Report the outcome of every physical connection attempt, identifying the client certificate used by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3257](StackExchange/StackExchange.Redis#3257)
- Use a dedicated pub/sub connection under RESP3 by default by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3264](StackExchange/StackExchange.Redis#3264)

#### Tooling

- docs(agents): add create-implementation-plan-for-redis-api-change skill by [@&#8203;uglide](https://github.com/uglide) in [#&#8203;3268](StackExchange/StackExchange.Redis#3268)

#### New Contributors

- [@&#8203;Laurianti](https://github.com/Laurianti) made their first contribution in [#&#8203;3256](StackExchange/StackExchange.Redis#3256)

**Full Changelog**: <StackExchange/StackExchange.Redis@3.3.1...3.4.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNDkuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE0OS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.milkshake.services/FloatingMilkshake/MechanicalMilkshake/pulls/9
Reviewed-by: Milkshake <floatingmilkshake@noreply.milkshake.services>
FloatingMilkshake pushed a commit to FloatingMilkshake/Azusa that referenced this pull request Oct 9, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [StackExchange.Redis](https://seredis.dev/) ([source](https://github.com/StackExchange/StackExchange.Redis)) | nuget | minor | `3.3.1` → `3.4.0` |

---

### Release Notes

<details>
<summary>StackExchange/StackExchange.Redis (StackExchange.Redis)</summary>

### [`v3.4.0`](https://github.com/StackExchange/StackExchange.Redis/releases/tag/3.4.0)

[Compare Source](StackExchange/StackExchange.Redis@3.3.1...3.4.0)

#### Major Changes

- In RESP3, by default the library now uses **separate** connections for pub/sub; see [#&#8203;3264](StackExchange/StackExchange.Redis#3264)
- Smart-client-handoffs is now enabled by default on Redis Enterprise and AMR; see [#&#8203;3248](StackExchange/StackExchange.Redis#3248)
- Some logging events incorrectly used duplicated ids - resolved; see [#&#8203;3266](StackExchange/StackExchange.Redis#3266)

#### All Changes

- Recover promptly from a cluster failover; fix the configuration channel under RESP3 and with a channel prefix ([#&#8203;3254](StackExchange/StackExchange.Redis#3254)) by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3255](StackExchange/StackExchange.Redis#3255)
- Preserve binary members as VectorSetRange bounds by [@&#8203;Laurianti](https://github.com/Laurianti) in [#&#8203;3256](StackExchange/StackExchange.Redis#3256)
- Smart client handoffs: reinstate auto-enlistment for the hosted providers and remove \[Experimental] by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3248](StackExchange/StackExchange.Redis#3248)
- docs: fix retry-category test in the custom RetryPolicy sample by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3265](StackExchange/StackExchange.Redis#3265)
- Fix duplicate LoggerMessage event ids; add a guard test by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3266](StackExchange/StackExchange.Redis#3266)
- Scan: observe the faults of abandoned page tasks after a sync timeout or dispose ([#&#8203;3260](StackExchange/StackExchange.Redis#3260)) by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3267](StackExchange/StackExchange.Redis#3267)
- Report the outcome of every physical connection attempt, identifying the client certificate used by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3257](StackExchange/StackExchange.Redis#3257)
- Use a dedicated pub/sub connection under RESP3 by default by [@&#8203;mgravell](https://github.com/mgravell) in [#&#8203;3264](StackExchange/StackExchange.Redis#3264)

#### Tooling

- docs(agents): add create-implementation-plan-for-redis-api-change skill by [@&#8203;uglide](https://github.com/uglide) in [#&#8203;3268](StackExchange/StackExchange.Redis#3268)

#### New Contributors

- [@&#8203;Laurianti](https://github.com/Laurianti) made their first contribution in [#&#8203;3256](StackExchange/StackExchange.Redis#3256)

**Full Changelog**: <StackExchange/StackExchange.Redis@3.3.1...3.4.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNDkuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE0OS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.milkshake.services/FloatingMilkshake/Azusa/pulls/9
Reviewed-by: Milkshake <floatingmilkshake@noreply.milkshake.services>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant