-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rosmaster publisherUpdate fails with: [Errno 9] Bad file descriptor #1523
Comments
Please provide more context (e.g. the platform and version you are using) as well as a reproducible example. |
We use ROS Kinetic 1.12.15 on Ubuntu 16.04. Unfortunately I couldn't get minimal reproducible example. This bug appears on our production environment with frequency about 2 fails on 700 test runs. I tried to make some fix: #1524 (comment) but it failed tests. |
I made a minimal reproducible example consisting of 1 fake_generator and 5 fake_subscribers. fake_generator node advertises 100 topics after 5 sec delay and sends some fake messages. fake_subscriber nodes are subscribes to all 100 topics and waits for 100 messages. For 5 runs I get about 1 fail: publisherUpdate fails because of bug described above and therefore one of subscribers can't get all messages. fake_generator:
fake_consumer:
|
I tried to reproduce the issue with the two scripts you provided with Melodic but couldn't. I modified the
right after:
I than ran the
Even after 10000+ iterations I never had the case where consumer didn't receive all messages. Can you please double check that you are seeing the problem with Melodic on Ubuntu 18.04 with the modified setup I described. Thanks. |
xmlrpc.client.ServerProxy is not thread safe. See https://bugs.python.org/issue6907 The symptom of this bug is exceptions in the publisherUpdate logged in the master.log. For example: [rosmaster.threadpool][ERROR] : Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run result = cmd(*args) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 210, in publisher_update_task ret = xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 68, in xmlrpcapi close_half_closed_sockets() File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 79, in close_half_closed_sockets state = transport._connection[1].sock.getsockopt(socket.SOL_TCP, socket.TCP_INFO) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) File "/usr/lib/python2.7/socket.py", line 174, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor Some subscribers get the update but some do not. For example, the topic is recorded in a rosbag but not received by nodes that depend on it. Issue: ros#1523
@dirk-thomas the underlying issue is that |
xmlrpc.client.ServerProxy is not thread safe. See https://bugs.python.org/issue6907 The symptom of this bug is exceptions in the publisherUpdate logged in the master.log. For example: [rosmaster.threadpool][ERROR] : Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run result = cmd(*args) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 210, in publisher_update_task ret = xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 68, in xmlrpcapi close_half_closed_sockets() File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 79, in close_half_closed_sockets state = transport._connection[1].sock.getsockopt(socket.SOL_TCP, socket.TCP_INFO) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) File "/usr/lib/python2.7/socket.py", line 174, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor Some subscribers get the update but some do not. For example, the topic is recorded in a rosbag but not received by nodes that depend on it. Issue: ros#1523
xmlrpc.client.ServerProxy is not thread safe. See https://bugs.python.org/issue6907 The symptom of this bug is exceptions in the publisherUpdate logged in the master.log. For example: [rosmaster.threadpool][ERROR] : Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run result = cmd(*args) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 210, in publisher_update_task ret = xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 68, in xmlrpcapi close_half_closed_sockets() File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 79, in close_half_closed_sockets state = transport._connection[1].sock.getsockopt(socket.SOL_TCP, socket.TCP_INFO) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) File "/usr/lib/python2.7/socket.py", line 174, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor Some subscribers get the update but some do not. For example, the topic is recorded in a rosbag but not received by nodes that depend on it. Issue: #1523
Assuming #1732 resolve the problem I will go ahead and close this. |
xmlrpc.client.ServerProxy is not thread safe. See https://bugs.python.org/issue6907 The symptom of this bug is exceptions in the publisherUpdate logged in the master.log. For example: [rosmaster.threadpool][ERROR] : Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run result = cmd(*args) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 210, in publisher_update_task ret = xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 68, in xmlrpcapi close_half_closed_sockets() File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 79, in close_half_closed_sockets state = transport._connection[1].sock.getsockopt(socket.SOL_TCP, socket.TCP_INFO) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) File "/usr/lib/python2.7/socket.py", line 174, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor Some subscribers get the update but some do not. For example, the topic is recorded in a rosbag but not received by nodes that depend on it. Issue: #1523
xmlrpc.client.ServerProxy is not thread safe. See https://bugs.python.org/issue6907 The symptom of this bug is exceptions in the publisherUpdate logged in the master.log. For example: [rosmaster.threadpool][ERROR] : Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run result = cmd(*args) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 210, in publisher_update_task ret = xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 68, in xmlrpcapi close_half_closed_sockets() File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 79, in close_half_closed_sockets state = transport._connection[1].sock.getsockopt(socket.SOL_TCP, socket.TCP_INFO) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) File "/usr/lib/python2.7/socket.py", line 174, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor Some subscribers get the update but some do not. For example, the topic is recorded in a rosbag but not received by nodes that depend on it. Issue: #1523
xmlrpc.client.ServerProxy is not thread safe. See https://bugs.python.org/issue6907 The symptom of this bug is exceptions in the publisherUpdate logged in the master.log. For example: [rosmaster.threadpool][ERROR] : Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run result = cmd(*args) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 210, in publisher_update_task ret = xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 68, in xmlrpcapi close_half_closed_sockets() File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 79, in close_half_closed_sockets state = transport._connection[1].sock.getsockopt(socket.SOL_TCP, socket.TCP_INFO) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) File "/usr/lib/python2.7/socket.py", line 174, in _dummy raise error(EBADF, 'Bad file descriptor') error: [Errno 9] Bad file descriptor Some subscribers get the update but some do not. For example, the topic is recorded in a rosbag but not received by nodes that depend on it. Issue: #1523
It seems that rosmaster is not thread safe which leads to rare errors with rate of about 2 fails on 700 runs.
The text was updated successfully, but these errors were encountered: