-
Notifications
You must be signed in to change notification settings - Fork 951
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
Setting reconnect_delay=0 in AsyncModbusTcpClient causes infinite busy-loops on connection loss #1794
Comments
Sounds like you have found a bug, thanks for reporting it. I have enough information to debug and hopefully find/repair the problem. |
Please give your program a go, with this patch installed: It should work, but I do not have time to test it thoroughly right now. |
Sorry I was too fast, this broke something. I will make a new version tomorrow. |
If you want to test use #1795 It will be part of either 3.5.3 or 3.6.0, but there are no confirmed time at this moment. |
Thanks for the quick fix, seems to look good so far in tests. |
Versions
Pymodbus Specific
Description
I tried setting reconnect_delay=0 in the constructor for AsyncModbusTcpClient as documented in https://pymodbus.readthedocs.io/en/latest/source/client.html#pymodbus.client.ModbusBaseClient to prevent the client from reconnecting if the TCP connection drops, but whenever the connection dropped pymodbus would instead busy-loop at 100%CPU forever.
Code and Logs
Minimal Example:
Logs (repeat ad-infimum):
For the server I used the following code and then just killed it with ^C after the first few successful reads:
The text was updated successfully, but these errors were encountered: