Skip to content

Commit

Permalink
Allow reuse address when firing up the ros2cli daemon.
Browse files Browse the repository at this point in the history
Especially in tests where the daemon is being repeatedly
created and destroyed, it can take some time for the kernel
to actually allow the address to be rebinded (even after the
old process has exited).  This can lead to some situations
where we fail to spawn the daemon.

To fix this, set "allow_reuse_address" inside the LocalXMLRPCServer,
which will set SO_REUSADDR on the socket.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Nov 18, 2024
1 parent 8766c33 commit 7a3bb44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ros2cli/ros2cli/xmlrpc/local_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_local_ipaddrs():

class LocalXMLRPCServer(SimpleXMLRPCServer):

allow_reuse_address = False
allow_reuse_address = True

def server_bind(self):
# Prevent listening socket from lingering in TIME_WAIT state after close()
Expand Down

0 comments on commit 7a3bb44

Please sign in to comment.