Open dwrobel opened 1 year ago
Hi Sounds like typical linux system Issue not specific to this project https://easyengine.io/tutorials/linux/increase-open-files-limit/
Issue not specific to this project
Actually it's quite opposite. Please have a look at the dump of lsof
for modbus-proxy
and you will see that the process keeps not closed sockets in the CLOSE_WAIT
state, whch basically mean that the socket received FIN
but the operating system is waiting for the process to locally close the connection. See: TCP socket states for CLOSE-WAIT
.
Sounds like typical...
Indeed, it sounds like a typical socket leak, where suggestion for increasing the number of maximum opened socket connections will only postpone the problem rather then fix it at the root cause.
Description
Here is my configuration:
There is a device
A
behind192.168.160.202:502
which is powered on and responses to the requests while the192.168.160.57:502
is connected to the https://github.com/arendst/Tasmota which works as a Modbus TCP to RTU converter. There are two devicesB
andC
connected to the serial port of Tasmota andB
is powered on whileC
is not (it's intentional).There are three Modbus to MQTT clients:
M1
,M2
andM3
which in a loop asks every 5 seconds for a data from devicesA
,B
andC
. It is expected that client which connects to deviceC
will observe permanent connection error while it's not expected that it will leak resources (sockets).What I Did