Skip to content

ServiceEnumerator: add configurable busyRepeatRequest retry count#32

Closed
Copilot wants to merge 1 commit into
masterfrom
copilot/add-busyrepeatrequest-option
Closed

ServiceEnumerator: add configurable busyRepeatRequest retry count#32
Copilot wants to merge 1 commit into
masterfrom
copilot/add-busyrepeatrequest-option

Conversation

Copy link
Copy Markdown

Copilot AI commented May 2, 2026

ServiceEnumerator previously allowed at most one retry on NRC 0x21 (busyRepeatRequest) via the boolean retry_if_busy_returncode flag. There was no way to control how many times the retry should be attempted.

Changes

  • New kwarg retry_if_busy_returncode_count (int, default 3): maximum number of times a request is re-sent after receiving a busyRepeatRequest NRC. Validated as >= 0.
  • Per-state retry counter _busy_repeat_request_count (defaultdict(int)): tracks in-flight busy retries per EcuState; incremented on each busy response, reset on a non-busy response or when the limit is exceeded.
  • _evaluate_retry rewritten: directly manages _retry_pkt and the new counter instead of delegating to _populate_retry, which only supported a single retry.

Usage

# Default: retry up to 3 times on busyRepeatRequest
enumerator.execute(socket, state, retry_if_busy_returncode=True)

# Custom count
enumerator.execute(socket, state,
                   retry_if_busy_returncode=True,
                   retry_if_busy_returncode_count=5)

# Disable retries entirely (count=0 or the existing bool flag)
enumerator.execute(socket, state, retry_if_busy_returncode_count=0)

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.

2 participants