[question] reconnection delay #375
Comments
Here's some speculation from a non-cppTango developer: 1 and 2. Looking at cppTango code, 3. There is definitely a delay implemented on the client side. Not sure if there is a delay on the server side too. With some basic testing I can connect to new server less than 1 second after it has started (this is using nodb mode, and starting the client after the server). That suggests that it is only client side. 4. I'm not sure why it exists. My guess is to reduce excessive resource usage. If clients were to retry connections with a very short delay that could spin the client's CPU, maybe hit the DatabaseDS repeatedly for IOR lookups, and cause unnecessary network traffic. If a server has gone offline for a while, there is no need for clients to try and reconnect more than once per second. From the git blame on the cppTango code, this delay has been around for at least 10 years. It cannot be disabled. If you can ensure that the devices are running before the clients that use them, then you would be able to avoid this problem. |
Hard to reproduce but it seems I can sometimes instantiate a DeviceProxy and get a PS: this situation occurs when the device is in the process of starting up. |
Indeed the DeviceProxy construction will not raise an exception if the connection attempt occurring during the construction failed. And you actually get an error when really trying to use the DeviceProxy object to execute a command, read/write an attribute or a pipe on this device since there was already a failed attempt to connect less than 1 second ago (when the DeviceProxy constructor was invoked). |
Ok that explains the behavior I'm observing. Thanks! |
When I see the exception
The connection request was delayed. Last connection request was done less than 1000 ms ago
DeviceProxy
helps.Connection
but I don't know what that means.The text was updated successfully, but these errors were encountered: