Skip to content
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

Problem of md5sum warning when web is refreshed #138

Closed
dwlee opened this issue Oct 28, 2014 · 13 comments
Closed

Problem of md5sum warning when web is refreshed #138

dwlee opened this issue Oct 28, 2014 · 13 comments

Comments

@dwlee
Copy link
Contributor

dwlee commented Oct 28, 2014

When web client using roslibjs is refreshed, md5sum warning is occurred. And then the refreshed client can not publish topic for about some second.

The situation is as below.

  1. Launch rosbridge.
    roslaunch rosbridge_server rosbridge_websocket.launch --screen
  2. Load test client 1 html (It is simple html page. it just publishes /chatter message which is std_msgs/String type).
  3. Load test client 2 html (it only subscribe message sent client 1).
  4. Send the string message by /chatter in client 1.
  5. Check received message in client 2 side.
  6. If you check the received message, and refresh the client 2. The md5sum warning will be happened as below. Try to publish again at client 1, but client 2 can not receive message for a little while .
[WARN] [WallTime: 1412842915.168814] Could not process inbound connection: [/rosbridge_websocket] is not a publisher of [/chatter]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': 'string data\n\n', 'callerid': '/rosbridge_websocket', 'tcp_nodelay': '0', 'md5sum': '992ce8a1687cec8c8bd883ec73ca41d1', 'topic': '/chatter', 'type': 'std_msgs/String'}

This is my test code.
https://github.com/robotics-in-concert/rocon_demos/tree/office_concert/office_web_interface/www/web_app/yujin_office/test_app

test_pub.html is client 1 and test_sub.html is client 2. If push the chatterbutton client 1 publish the simple string included count message.

@rctoris
Copy link
Contributor

rctoris commented Oct 28, 2014

Can you provide your example code?

@dwlee
Copy link
Contributor Author

dwlee commented Oct 28, 2014

I updated the url

@jihoonl
Copy link
Member

jihoonl commented Oct 28, 2014

The issue is that rosbridge unregiesters and reestablishs the publisher with same topic name every page refresh. It has caused some topic msg loss when the newly fresh page starts to publish immediately.

The issue is actually the limitation of rospy but we wanted to share since it could be a common issue for web apps using rosbridge. Here is related rospy issue

@jihoonl
Copy link
Member

jihoonl commented Oct 28, 2014

To reproduce warning message only with rospy,

Terminal 1

> rostopic echo /chatter  # with roscore

Terminal 2 with this code

#!/usr/bin/env python

import rospy
import std_msgs.msg

if __name__ == '__main__':

    rospy.init_node("chatchat_pub")
    test_pub = rospy.Publisher('chatter', std_msgs.msg.String, queue_size=1)
    rospy.loginfo("Publishing")
    test_pub.publish('hola')
    rospy.loginfo("Done")
    rospy.sleep(1)
    rospy.loginfo("Unregistering...")
    test_pub.unregister()
    rospy.loginfo("Done")
    rospy.spin()

Then you will see below as a result.

jihoonl@whoola:~/research/ros/isolate/src/test$ ./test.py 
[INFO] [WallTime: 1414462063.709317] Publishing
[INFO] [WallTime: 1414462063.709492] Done
[INFO] [WallTime: 1414462064.710662] Unregistering...
[WARN] [WallTime: 1414462064.711620] Could not process inbound connection: [/chatchat_pub] is not a publisher of [/chatter]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': 'string data\n\n', 'callerid': '/rostopic_32229_1414462060102', 'tcp_nodelay': '0', 'md5sum': '992ce8a1687cec8c8bd883ec73ca41d1', 'topic': '/chatter', 'type': 'std_msgs/String'}
[INFO] [WallTime: 1414462064.712748] Done
[WARN] [WallTime: 1414462065.713453] Could not process inbound connection: [/chatchat_pub] is not a publisher of [/chatter]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': 'string data\n\n', 'callerid': '/rostopic_32229_1414462060102', 'tcp_nodelay': '0', 'md5sum': '992ce8a1687cec8c8bd883ec73ca41d1', 'topic': '/chatter', 'type': 'std_msgs/String'}
[WARN] [WallTime: 1414462067.716019] Could not process inbound connection: [/chatchat_pub] is not a publisher of [/chatter]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': 'string data\n\n', 'callerid': '/rostopic_32229_1414462060102', 'tcp_nodelay': '0', 'md5sum': '992ce8a1687cec8c8bd883ec73ca41d1', 'topic': '/chatter', 'type': 'std_msgs/String'}


[WARN] [WallTime: 1414462071.719720] Could not process inbound connection: [/chatchat_pub] is not a publisher of [/chatter]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': 'string data\n\n', 'callerid': '/rostopic_32229_1414462060102', 'tcp_nodelay': '0', 'md5sum': '992ce8a1687cec8c8bd883ec73ca41d1', 'topic': '/chatter', 'type': 'std_msgs/String'}
[WARN] [WallTime: 1414462079.727917] Could not process inbound connection: [/chatchat_pub] is not a publisher of [/chatter]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': 'string data\n\n', 'callerid': '/rostopic_32229_1414462060102', 'tcp_nodelay': '0', 'md5sum': '992ce8a1687cec8c8bd883ec73ca41d1', 'topic': '/chatter', 'type': 'std_msgs/String'}

@jihoonl
Copy link
Member

jihoonl commented Oct 28, 2014

A quick hack to prevent the problem is commenting out topic unregistration in rosbridge_library/pulibhser.py

311# if not self._publishers[topic].has_clients():
312#           self._publishers[topic].unregister()
313#            del self._publishers[topic]

jihoonl added a commit to robotics-in-concert/rosbridge_suite that referenced this issue Jan 22, 2015
mvollrath added a commit to EndPointCorp/rosbridge_suite that referenced this issue Jun 24, 2015
@rctoris rctoris added the Bug Fix label Jul 7, 2015
@T045T
Copy link
Contributor

T045T commented Jan 18, 2016

Since several forks have adopted this "quick hack", and it doesn't look like rospy is going to fix the root cause any time soon (assuming it's possible to do so), how about a nicer solution?

I'm thinking a timeout for unregistering topics with no clients, so the publisher survives quick page reloads, but rosbridge doesn't leak publishers. This is particularly important in connection with the service-based tf2_web_republisher, as that will generate new topics for each new client (and as such, for each page reload).

If you think a timeout is an acceptable solution, I'll implement it :)

@jihoonl
Copy link
Member

jihoonl commented Jan 25, 2016

Yeah. I think it would be sufficient to keep it in the main stream with some explanation. Thanks @T045T

@salsalam
Copy link

salsalam commented Apr 7, 2016

I'm new to ROS and rosbridge. I am receiving these warnings and would like to prevent them. Is it still the case that I should adopt the "quick hack"? I am running 0.7.13 since I used sudo apt-get install ros-indigo-rosbridge... to install and that's what it gave me.

Thanks for any help you can provide.

@Sanic
Copy link
Contributor

Sanic commented Dec 1, 2016

I'm interested in that too.
@T045T Did you manage to implement the Timeout yet?

v-lopez pushed a commit to v-lopez/rosbridge_suite that referenced this issue Jan 12, 2017
T045T added a commit that referenced this issue Feb 8, 2017
Delay unregister to mitigate #138
le-kang added a commit to uts-magic-lab/rosbridge_suite that referenced this issue Jun 14, 2017
@jihoonl jihoonl removed the Bug Fix label Jun 29, 2017
@jihoonl
Copy link
Member

jihoonl commented Nov 20, 2017

This should be mitigated by #247

@jihoonl jihoonl closed this as completed Nov 20, 2017
@jihoonl
Copy link
Member

jihoonl commented Nov 20, 2017

Otherwise, this is an issue in rospy not in rosbridge.

@paul-mesnilgrente
Copy link

Hi everyone,

I see that this is an old issue and it seems to be solved. However I have this message:

[WARN] [1511259980.900398]: Could not process inbound connection: [/rosbridge_websocket] is not a publisher of [/ui_action]. Topics are [['/text_to_speech', 'std_msgs/String'], ['/speech_to_text', 'std_msgs/String'], ['/rosout', 'rosgraph_msgs/Log']]{'message_definition': 'string data\n', 'callerid': '/rosbridge_websocket', 'tcp_nodelay': '0', 'md5sum': '992ce8a1687cec8c8bd883ec73ca41d1', 'topic': '/ui_action', 'type': 'std_msgs/String'}

I am using ros-kinetic on Ubuntu 16.04. Should I apply the quick fix or it has been added to the ubuntu package?

jorgenfb added a commit to jorgenfb/rosbridge_suite that referenced this issue Feb 8, 2018
Pull request RobotWebTools#247 introduces a 10 second delay to mitigate issue RobotWebTools#138.
This change makes this delay configurable by passing an argument either
on the command line or when including a launch file.

Usage example:
```xml
<launch>
  <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
    <arg name="unregister_timeout" value="5.0"/>
  </include>
</launch>
```

Closes RobotWebTools#320
jihoonl pushed a commit that referenced this issue Feb 24, 2018
Pull request #247 introduces a 10 second delay to mitigate issue #138.
This change makes this delay configurable by passing an argument either
on the command line or when including a launch file.

Usage example:
```xml
<launch>
  <include file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
    <arg name="unregister_timeout" value="5.0"/>
  </include>
</launch>
```

Closes #320
@gonzalocasas
Copy link
Contributor

The unregister timeout is really not a sustainable solution. I am using rosbridge_server in a context that is not about quick reconnects like the webpage reload case that was mentioned in several of the linked issues, and this really makes it extremely inconvenient to use.

Any hope for a fix for the root cause at some point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants