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

Avoid waiting in loops #164

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

mgrrx
Copy link
Contributor

@mgrrx mgrrx commented Mar 27, 2020

Using strace we recently figured out that Python nodes are waking up quite frequently and usually this is done for, let's say, no reason.

In the action server implementation here we basically just want to ensure that the executeLoop does not block if we terminate the executable. I rewrote that part by using a condition object and the shutdown hooks.

At the same time I removed the terminate_mutex since it's not needed - at least I couldn't see any reason for it.

Waiting for 100ms actually does not mean that your program is sleeping for 100ms (https://github.com/python/cpython/blob/2.7/Lib/threading.py#L350).

Copy link
Contributor

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think that this fix is reasonable. but someone else needs to review to confirm.

@fujitatomoya
Copy link
Contributor

@fujitatomoya
Copy link
Contributor

rostest.runner.RosTest.testtest_cpp_simple_client has been in some problems in CI, I am not sure what goes wrong but it just does not get succeeded. (sometimes raise exeception, sometimes timeout so the state is still in active state.)

@mgrrx
Copy link
Contributor Author

mgrrx commented Mar 30, 2020

I assume it's unrelated since there are similar failures every now and then

@jschleicher
Copy link
Contributor

Regarding the test I guess it's the same as in #156 (comment).

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

Successfully merging this pull request may close these issues.

3 participants