-
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
Fix/107 #831
Fix/107 #831
Conversation
@@ -189,7 +193,7 @@ class Poller(object): | |||
""" | |||
def __init__(self): | |||
try: | |||
self.poller = select.poll() | |||
self.poller = select.epoll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this affect cross platform compatibility? The documentation only mentions Linux, what about OS X and Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Poller class in topics.py provides a unified interface for polling on all three platforms. I cleaned up the code a bit (48f4f0a) and added a fallback to select.poll for Linux < 2.5.44. I did not touch the code for OS X and Windows. So regarding the compatibility I'd say that this PR does not affect the compatibility.
@dirk-thomas anything that keeps this from merging (to kinetic)? |
It is mostly due to not having the time to thoroughly test this patch. Hopefully I can get back to this in the near future. |
We can reproduce the escalation of open file descriptors - |
Any plans for releasing this fix soon @dirk-thomas? We've been using it on both indigo and kinetic robots since November and haven't found any regression. Let us know if we can help with specific tests. |
@alain-m thanks for testing this. |
Since it has been tested by two parties for a while already I would be fine with merging a PR against kinetic-devel now. The kinetic-edge branch can be rebased against the latest master afterwards to also cover this until the next release. |
Added a fallback to select.poll if select.epoll is not available in Linux. OS X will still use kqueue and Windows the noop operator.
Removed whitespace
…rded but the lock is only acquired when connection list needs to be modified. This avoids unnecessary locking.
@dirk-thomas I've moved this to kinetic-devel. No idea why Jenkins has problems with it. Can you have a look and merge it if acceptable? |
@ros-pull-request-builder retest this please |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
# Revision $Id: gossipbot.py 1013 2008-05-21 01:08:56Z sfkwc $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should probably be removed.
I can't say why it didn't trigger the kinetic job after rebasing and "asking Jenkins nicely". I triggered the job manually (http://build.ros.org/view/Kpr/job/Kpr__ros_comm__ubuntu_xenial_amd64/272/) but it won't show up as a build status here when its finished. |
Your latest push to the branch triggered a new build anyway. Waiting for the result on that... |
|
||
import psutil | ||
|
||
from std_msgs.msg import String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just about to merge this. But on a last view through the diff I saw that std_msgs
is currently neither a runtime nor test dependency yet. Can you please add it as a <test_depend>std_msgs</test_depend>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but now it's upset because it was already listed as a build dependency. Maybe just switch this package to format 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry. I am only using format 2 nowadays. Can you please just remove the added test dependency again. No need to update to the new format in this PR.
No problem, done.
|
Fixes #107
I replaced the poll() behavior in rospy by epoll() which allows to check for EPOLLRDHUP events. Extract from the man page epoll_ctl:
Using that event we can easily check for closed connections that were hung up by the remote node. I added that check to the regmanager to gracefully close those connections in its update loop. Especially latched publishers suffered from the old behavior as the messages are normally sent only once.
The fix works also on kinetic