Skip to content

100% Action Server CPU usage after goal is done until it is expired #354

@sloretz

Description

@sloretz

Bug report

Required Info:

Steps to reproduce issue

  1. Start top in a terminal
  2. Start an action server using rmw_fastrtps_cpp
    RMW_IMPLEMENTATION=rmw_fastrtps_cpp ./build/test_communication/test_action_server_cpp Fibonacci /foo/bar
    
  3. Start an action client using rmw_fastrtps_cpp
    RMW_IMPLEMENTATION=rmw_fastrtps_cpp ./build/test_communication/test_action_client_cpp Fibonacci /foo/bar
    

Expected behavior

I would expect negligible CPU usage after the goal has finished processing

Actual behavior

Server using 100% CPU after the goal has finished processing

Additional information

It does not happen using RMW connext.

If I debug the server, it seems that there is a loop inside rclcpp::spin() where rcl_wait() wakes indicating a timeout, the executor checks and nothing is ready so it goes back into rcl_wait() which wakes immediately with a timeout. The timeout given to rcl_wait() is -1 which becomes INT_MAX when passed to rmw_wait(). The 100% CPU usage ends when the action server expires the old goal (after 15 minutes by default).

Maybe there's an issue with how rcl_action_server is using the timer api (#343)?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions