ros2 / rmw_fastrtps

Implementation of the ROS Middleware (rmw) Interface using eProsima's Fast RTPS.
Apache License 2.0
157 stars 117 forks source link

AsyncWriterThread takes 60% CPU time #611

Closed micxiaoc closed 1 year ago

micxiaoc commented 2 years ago

Bug report

Required Info:

Steps to reproduce issue

When using rosbridge, asyncwriterthread will be generated after a few hours, which will occupy a high CPU and remain at 60%. Is there any way to reduce the CPU on foxy #### Expected behavior CPU can remain stable #### Actual behavior Asyncwriterthread raises CPU #### Additional information

Feature request

Feature description

Implementation considerations

clalancette commented 2 years ago

@MiguelCompany @EduPonz I believe the AsyncWriterThread is a part of the underlying Fast-DDS 2.1.x implementation that is in Foxy. Any ideas on what might be going on here?

EduPonz commented 2 years ago

Hi,

Each Participant holds an AsyncWriterThread instance that is used to:

  1. Send user data coming from asynchronous writers (as all ROS 2 writers are by default).
  2. Take care of re-sendings in the case of reliable writers.
  3. Take care of feeding data to late joiners which DurabilityQosPolicy is other than VOLATILE.

asyncwriterthread will be generated after a few hours

Because of the previous, I'm not sure I understand what you mean with this; the async thread may de stalling but it should always exist.

Could you try to reproduce in 2.1.x?

clalancette commented 1 year ago

No response in a year here, so closing this out. If you are still having problems, please open a new issue.