Skip to content

Partial solve ext. cancel sideeffects. - #3072

Merged
janiversen merged 1 commit into
devfrom
solve_3070
Oct 29, 2026
Merged

janiversen merged 1 commit into
devfrom
solve_3070

Conversation

@janiversen

Copy link
Copy Markdown
Collaborator

fixes #3070

This PR solves the below scenario, but as noted it is not possible to solve it 100% due to protocol limitations (no TID)

scenario:

  • app sends a request
  • pymodbus sends the request on it's way, device responds in x ms.
  • app cancels task before response arrives.

If the app do not send a new request until after x ms, the response will be discarded.

if the app sends a new request less than x ms, then there are no way (no transaction id in rtu frames) to identify whether it is an old response or the correct one.

Pymodbus checks device_id (except broadcast), and function code but that does not work if the app sends same type of request.

@janiversen
janiversen merged commit b9cd6c6 into dev Oct 29, 2026
16 checks passed
@janiversen
janiversen deleted the solve_3070 branch October 29, 2026 11:04
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.

Async cancellation can lead to incorrect register data being returned on subsequent calls

1 participant