-
Notifications
You must be signed in to change notification settings - Fork 912
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
Use thread local storage for caching instances of ServerProxy #1732
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I retargeted the patch to the |
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
johnfettig
force-pushed
the
xmlrpc_threading_bug
branch
from
August 16, 2019 02:54
5736a2c
to
cfddbdd
Compare
@dirk-thomas please let me know if any further action is required to have this merged. |
Thank you for the patch. |
dirk-thomas
pushed a commit
that referenced
this pull request
Aug 4, 2020
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
dirk-thomas
pushed a commit
that referenced
this pull request
Aug 4, 2020
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
dirk-thomas
pushed a commit
that referenced
this pull request
Aug 4, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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