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

Race condition: Goal state is SUCCEEDED before result is available. #116

Open
jorgenfb opened this issue Oct 27, 2018 · 4 comments
Open

Comments

@jorgenfb
Copy link

SimpleActionClient seems to have a race condition. Calling get_state() can give the SUCCEEDED state before a result is available.

This is a package showing the problem. It uses a SimpleActionClient to make a request and then checks client.get_state() at a high frequency to check for SUCCEEDED state and then checks if client.get_result() returns a result. An error is printed if the result is missing. It makes a maximum of 1000 requests to try to trigger this error. Run roslaunch action_client_breaker action_client_breaker.test and wait for a ERROR message in the console.
action_client_breaker.zip

BufferClient in tf2_ros was previously affected by this issue. See ros/geometry2#178.

@HappySamuel
Copy link

Hi @jorgenfb

I also faced this issue when i am calling client.get_state() at around 5Hz. Have you find a solution / workaround for this?

Best,
Samuel

@jorgenfb
Copy link
Author

Yes, have a look at ros/geometry2#178. Especially this comment: ros/geometry2#178 (comment). You might be able to use:

your_simple_action_client.wait_for_result()

@HappySamuel
Copy link

Isn't the client.wait_for_result() will put whole system on wait? until result come out?

@jorgenfb
Copy link
Author

jorgenfb commented Oct 27, 2021 via email

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

2 participants