Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(inputs.modbus): Do not fail if a single slave reports errors #11785

Merged
merged 4 commits into from Sep 15, 2022

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Sep 9, 2022

resolves #11782

In the current implementation the modbus plugin will error out as soon as the first slave fails. This is a problem when querying multiple slaves over one interface (as in #11782) or when using ModbusTCP gateways as we loose one gather cycle for all devices after a failing one.

The current PR changes this behavior and only skips the failing slave (after busy-retry) but continues with other ones in the row.

@telegraf-tiger telegraf-tiger bot added area/modbus fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Sep 9, 2022
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Sep 9, 2022

Copy link
Contributor

@reimda reimda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Instead of failing out of the whole gather, now if one slave fails it moves on.

@reimda reimda merged commit d637a66 into influxdata:master Sep 15, 2022
reimda pushed a commit that referenced this pull request Sep 19, 2022
@srebhan srebhan deleted the modbus_slave_fixes branch November 7, 2022 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/modbus fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telegraf Modbus RTU - Do not throw all the data if a slave on the bus is not reachable
2 participants