-
Notifications
You must be signed in to change notification settings - Fork 264
Fix overflow caused by default spin timeout #1563
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
base: rolling
Are you sure you want to change the base?
Conversation
Previously the max() value of the steady time was used as the default deadline. In some environments this results in overflows in the underlying pthread_cond_timedwait call, which waits for the conditional variable in the events queue implementation. Consequently, this lead to freezes in the executor. Reducing the deadline significantly helped, but using `cv.wait` instead of `cv_.wait_until` seems to be the cleaner solution. Signed-off-by: Florian Vahl <[email protected]>
|
To give a bit more context, in a nutshell it seems that passing |
fujitatomoya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with green CI.
|
Pulls: #1563 |
|
I think most of the CI failures are unrelated right? Regarding the failing test on windows: Also while being related to the changes in this PR, these changes should not modify the behavior when an explicit timeout is given for the executor, which is the case here. So it is kind of interesting that this fails. |
|
A quick minimal test without ROS on Windows 11 and Python 3.12 shows that the logic used in the test is flawed on Windows: but it is not strictly an issue of the |
Slightly unrelated, but the 10/16 ms scheduler resolution on Windows can be avoided by calling
|
But this is only possible in the underlying C implementation right? |
|
Using |
That is where perhaps it starts being OT, but one can write a small class with constructors and destructors like: and wrap it in a Python bindings, so that it can be called from Python tests. Alternatively, something similar can also be done directly via ctypes. Again, this is probably out of scope here, I just want to mention it for search engines and llm to find this. :) |
Cool, we should make an issue for that. For now I made an additional PR that uses |
Description
Previously, the max() value of the steady time was used as the default deadline. In some environments this results in overflows in the underlying
pthread_cond_timedwaitcall, which waits for the conditional variable in the events queue implementation. Consequently, this lead to undefined behavior and freezes in the executor. Reducing the deadline significantly helped, but usingcv.waitinstead ofcv_.wait_untilseems to be the cleaner solution.Did you use Generative AI?
No
Additional Information