I use twisted Perspective Broker to talk between client and server. The client requests the remote method "remote_ssh" from the server. This forces the PB server to initiate an SSH connection using the Paramiko SSH library and retrieve the configuration from the remote device.
All this works fine, but when I do this for several remote devices, I see the following behavior: the Perspective Broker client will send all requests to the PB server. Then the PB server will execute these requests one by one (this is normal), but it will not return ANY results until they are completed.
Here is the corresponding PB server code:
class RMethods(pb.Root): def remote_ssh(self, aDict): self.login('SSH', aDict)
From a look at the system level information (TCPDump and netstat), I see the following (suppose 5 remote method calls):
Call remote_ssh from PB Client on PB Server so that five remote devices happen at about the same time
self.login device 1 self.aSSH.retrieve() device 1 self.aSSH.close() device 1 self.login device 2 self.aSSH.retrieve() device 2 self.aSSH.close() device 2 ... self.login device 5 self.aSSH.retrieve() device 5 self.aSSH.close() device 5 return results for all 5 devices
I donโt understand why it is waiting for the results to return (that is, why it waited for Device5 to complete before the results for device1 are returned).
source share