ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Ok, almost 24 hours later and I have a solution (but not quite a full explanation).
It comes down to "something" that changed in the OSX build of python 2.7 on El Capitan with respect to handling sockets. The ROS ThreadingXMLRPCServer
python class inherits from the SimpleXMLRPCServer
class which inherits the SocketServer.TCPServer
class. The TCPServer class sets a default parameter request_queue_size=5
which controls how big it will allow the incoming connection queue to become (that is, the queue of _new_ connections - this value gets passed down to the python socket.listen()
function)
I don't know what changed in OSX 10.11, maybe the rate at which the kernel allows connections or maybe how socket.listen()
is implemented. Either way, I found any easy fix to be changing the ROS ThreadingXMLRPCServer
class:
class ThreadingXMLRPCServer(socketserver.ThreadingMixIn, SimpleXMLRPCServer):
"""
Adds ThreadingMixin to SimpleXMLRPCServer to support multiple concurrent
requests via threading. Also makes logging toggleable.
"""
def __init__(self, addr, log_requests=1):
"""
Overrides SimpleXMLRPCServer to set option to allow_reuse_address.
"""
# allow_reuse_address defaults to False in Python 2.4. We set it
# to True to allow quick restart on the same port. This is equivalent
# to calling setsockopt(SOL_SOCKET,SO_REUSEADDR,1)
self.allow_reuse_address = True
self.request_queue_size = 128
...
To increase the request_queue_size
variable. I'll make an issue/pull-request to the ros_comm
repos on github.