-
Notifications
You must be signed in to change notification settings - Fork 987
asyncio TCP client timeout broken #640
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
Labels
Comments
Could this be the root cause? Look at the def async_io_factory(host="127.0.0.1", port=Defaults.Port, framer=None,
source_address=None, timeout=None, **kwargs):
"""
Factory to create asyncio based asynchronous tcp clients
:param host: Host IP address
:param port: Port
:param framer: Modbus Framer
:param source_address: Bind address
:param timeout: Timeout in seconds
:param kwargs:
:return: asyncio event loop and tcp client
""" This function does not end up using the |
Merged
dhoomakethu
added a commit
that referenced
this issue
Oct 17, 2021
camtarn
pushed a commit
to camtarn/pymodbus
that referenced
this issue
Dec 6, 2021
camtarn
pushed a commit
to camtarn/pymodbus
that referenced
this issue
Dec 6, 2021
camtarn
added a commit
to camtarn/pymodbus
that referenced
this issue
Dec 6, 2021
camtarn
added a commit
to camtarn/pymodbus
that referenced
this issue
Dec 6, 2021
camtarn
added a commit
to camtarn/pymodbus
that referenced
this issue
Dec 6, 2021
camtarn
added a commit
to camtarn/pymodbus
that referenced
this issue
Dec 6, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Versions
Pymodbus Specific
Description
What were you trying?
A very simplistic TCP-only setup.
pip install pymodbus
To do this, created client like this:
Full server and client code can be found near the end of this report.
What did you expect?
That client waits for server to process the register-write, without raising
TimeoutError
exception.What went wrong?
Client raised
TimeoutError
exception. Log can be found near the end of this report.Observations
I snooped around the library code a bit, and stumbled upon
BaseAsyncModbusClient
class. It hasself._timeout
member, which gets default initialised to2
seconds.So I tried this instead:
And it works! It correctly waits long enough for the server to reply. So, I think somewhere in the library, the chain of
timeout
passing down to the base class has a breakage somewhere. I'm not sure though.Code and Logs
This is the server code. It is sync variant, but that is an irrelevant detail. This could be any sync/async variant.
This is the client code.
This is the output of the client code (for the case where bug is demonstrated).
The text was updated successfully, but these errors were encountered: