RobotWebTools / web_video_server

HTTP Streaming of ROS Image Topics in Multiple Formats
http://ros.org/wiki/web_video_server
Other
270 stars 188 forks source link

MultipartStream not leaving busy state (leading to high CPU usage) #82

Closed sfalexrog closed 5 years ago

sfalexrog commented 5 years ago

ROS distro: kinetic Package version: 0.1.0

I've noticed that sometimes, even after I close all tabs with web_video_server's streams, the web_video_server's process still consumes as much CPU as if it was still streaming. After a bit of debugging, I've found that bool Multipart::isBusy() always returns true, unable to clean up pending_footers_. This prevents MultipartStreamer from sending additional packets (and, from what I can tell, getting an exception and setting ImageStreamer::inactive_ flag).

This happens (and is most noticeable) on a Raspberry Pi, not so much on a desktop - sometimes I have to close and reopen the tabs multiple times, in quick succession.

I've attempted to work around this by having a timestamp assigned to every pending footer and removing "stale" footers: https://github.com/sfalexrog/web_video_server/commit/115f906bb90a2354e6d79518daf5920687701966. This is by no means a proper fix, though; any comments regarding the issue are very welcome!

130s commented 5 years ago

https://github.com/RobotWebTools/web_video_server/pull/83 seems to have addressed this already?

sfalexrog commented 5 years ago

Well, that's more of a workaround than of a proper fix, but the problem doesn't seem to manifest itself anymore. Guess the issue could be closed now.