Skip to content

Fix SDO abort addresses and block-upload end timeouts - #686

Open
dhairyajangir wants to merge 2 commits into
canopen-python:masterfrom
dhairyajangir:fix/sdo-block-upload-end-timeout
Open

dhairyajangir wants to merge 2 commits into
canopen-python:masterfrom
dhairyajangir:fix/sdo-block-upload-end-timeout

Conversation

@dhairyajangir

@dhairyajangir dhairyajangir commented Nov 10, 2026 •

Copy link
Copy Markdown

A missing block-upload end response previously called a nonexistent stream abort(), masking the communication timeout with AttributeError and sending no abort. This change calls the SDO client abort helper and re-raises the original timeout.

It also includes the requested object index/subindex in client aborts throughout expedited, segmented and block transfers. Each stream retains its original address before its first request; timeout and error paths use that context rather than interpreting segment payload bytes as an address. Retries, incoming remote-abort handling, abort reasons and COB IDs are preserved.

Existing abort() and abort(code) calls retain their defaults; direct calls without address context still use zero. The new address arguments are keyword-only. Subclasses overriding abort or request_response with narrower signatures must accept/forward these keywords; this requirement is documented.

Local Linux validation:

  • Python 3.9 and 3.12: all 45 focused cases and four real two-endpoint VirtualBus exchanges passed on each version.
  • Python 3.12: complete configured feature profiles passed: 325 tests plus one optional PDO-export skip, and 326 tests with db_export enabled.
  • make -C doc html passed without observed warnings.
  • Optional mypy still reports 44 errors in seven files, byte-identical to the previous PR head.

These results do not establish physical-device or strict-address-checking peer compatibility. Hosted CI has not run for this revision: the Python package run is action_required. Please authorize that run for the configured upstream tests and docs.

Fixes #377. Follow-up to #594.

AI assisted with investigation, the patch, and testing.

@dhairyajangir

dhairyajangir commented Nov 10, 2026 •

Copy link
Copy Markdown
Author

Scope update: this PR now also addresses #377, while retaining the original block-upload end-timeout fix. All internal stream abort and request/timeout paths carry the originally requested index/subindex. The 0x1008:00 end-timeout regression now expects 80 08 10 00 00 00 04 05, replacing the earlier helper's zero-address frame.

Legacy abort()/abort(code) defaults remain unchanged; explicit address arguments are keyword-only, and narrower subclass overrides must accept/forward them. The updated regression matrix and four two-endpoint VirtualBus exchanges passed on Python 3.9 and 3.12. These are local software-bus results; physical CAN and a device that validates abort addresses were not tested. Full local feature-profile results and the unchanged optional mypy failures are recorded in the PR body.

Codex assisted with this investigation, update and testing.

Retain the initiating index/subindex in each stream and pass it through
all existing abort and retry-timeout paths. Encode the address without
inferring it from segment data or retaining global transfer state.

Keep direct abort() and abort(code) calls valid, document the optional
address keywords and subclass override boundary, and cover the wire
frames, retry behavior and original block-upload end timeout.

AI assisted with investigation, implementation, review and testing.
@dhairyajangir dhairyajangir changed the title Fix timeout at the end of SDO block uploads Fix SDO abort addresses and block-upload end timeouts Nov 11, 2026
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.

Index + Subindex missing from abort messages

1 participant