-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
[modbus] reduce log level when modbus slave returns DEVICE_BUSY exception #3847
Conversation
…tion This exception is meant to indicate that the request should be retried shortly, essentially, and at least some of the devices I own seem to be busy bees. Thus my logs receive significant spam of this warning. Since the exception is transient and retrying it is the expected course of action, I think it makes sense to reduce the log level here slightly and only output an error when the retries get exhausted. Signed-off-by: Simonas Kazlauskas <git@kazlauskas.me>
@@ -662,7 +668,11 @@ private <R, C extends ModbusResultCallback, F extends ModbusFailureCallback<R>, | |||
} catch (ModbusSlaveException e) { | |||
lastError.set(new ModbusSlaveErrorResponseExceptionImpl(e)); | |||
// Slave returned explicit error response, no reason to re-establish new connection | |||
if (willRetry) { | |||
if (willRetry && e.getType() == MODBUS_EXCEPTION_SLAVE_DEVICE_BUSY) { | |||
logger.info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When re-trying is an expected operation, you can reduce that to DEBUG.
@nagisa : did you see the review comment? |
...rt.modbus/src/main/java/org/openhab/core/io/transport/modbus/internal/ModbusManagerImpl.java
Outdated
Show resolved
Hide resolved
…/openhab/core/io/transport/modbus/internal/ModbusManagerImpl.java Signed-off-by: Simonas Kazlauskas <github@kazlauskas.me>
@J-N-K : you can probably merge this PR now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! And sorry for letting you wait so long. I didn't see my comments were addressed.
This exception is meant to indicate that the request should be retried shortly, essentially, and at least some of the devices I own seem to be busy bees. Thus my logs receive significant spam of this warning.
Since the exception is transient and retrying it is the expected course of action, I think it makes sense to reduce the log level here slightly and only output an error when the retries get exhausted.