Skip to content

Classify 4xx (except 429) as terminal in RestSend retry policy - #502

Open
allenrobel wants to merge 1 commit into
developfrom
nd_restsend_4xx_terminal
Open

Classify 4xx (except 429) as terminal in RestSend retry policy#502
allenrobel wants to merge 1 commit into
developfrom
nd_restsend_4xx_terminal

Conversation

@allenrobel

Copy link
Copy Markdown
Contributor

Related Issue(s)

Addresses the 4xx half of #457 (deliberately does NOT close it — the 5xx retry question remains open for discussion there).

Proposed Changes

Implements the independently-shippable piece proposed in #457's field-report comment: a 4xx response proves the request reached the application and was rejected, so replaying the identical request cannot succeed. Previously a deterministic 400 (e.g. an immediately-rejected fabric mutation) was resubmitted every 5 seconds for the full 300-second RestSend budget, delaying module failure by 5 minutes with no user-facing knob to shorten it.

Test changes: five new ResponseHandler tests (01500–01540: POST 400 terminal, POST 429 retryable, GET 400 terminal, GET 404 contract, DELETE 404 terminal) and a deliberate rewrite of 01440, which previously pinned the "GET results carry no retryable key" behavior this PR removes.

Test Notes

  • Full unit suite passes in the nd-dev container machine: 3983 passed (ndpytest tests/unit/)
  • pylint 10.00/10 on the changed module; black/isort clean; mypy reports only the two errors pre-existing on develop

Cisco Nexus Dashboard Version

4.2.1

Related ND API Resource Category

  • analyze
  • infra
  • manage
  • onemanage
  • other

Checklist

  • Latest commit is rebased from develop with merge conflicts resolved
  • New or updates to documentation has been made accordingly
  • Assigned the proper reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_019XZiWNrVHYXbeNXRM8kUrz

@allenrobel allenrobel self-assigned this Aug 11, 2026
@allenrobel allenrobel added the ready for review Submitter is requesting a PR review label Aug 11, 2026
Implements the shippable half of issue #457: a 4xx response proves the
request reached the application and was rejected, so replaying the
identical request cannot succeed. Previously a deterministic 400 (e.g.
an immediately-rejected fabric mutation) was resubmitted every 5 seconds
for the full 300-second budget, delaying module failure by 5 minutes
with no user-facing knob to shorten it.

- ResponseHandler._is_terminal_client_error(): 400-499 minus 429 (rate
  limiting stays retryable; no retryable 4xx is documented for any ND
  4.2.1 endpoint - the dcnm-era retry-on-400 cases do not carry over).
- Mutations: the #398 retryable seam now also excludes terminal client
  errors; 5xx keeps the historical retry behavior (the 5xx question
  stays open on #457).
- GET: results now carry retryable, applying the same 4xx rule per the
  issue's scope note (a deterministic 400 on a GET burned the same
  budget); 5xx GETs stay retryable for eventual-consistency polling,
  and the 404 not-found-is-success contract is unchanged.

Full unit suite: 3983 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XZiWNrVHYXbeNXRM8kUrz
@allenrobel
allenrobel force-pushed the nd_restsend_4xx_terminal branch from a0dc44a to 4e2f773 Compare August 13, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Submitter is requesting a PR review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant