-
Notifications
You must be signed in to change notification settings - Fork 449
Fix race condition in test clock #2819
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
Fix race condition in test clock #2819
Conversation
d24f3a2
to
78411a6
Compare
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.
@pedroazeredo04 thank you very much for creating PR. can you retarget this PR against rolling
branch? that is our development branch where all fixes are supposed to be merged in rolling, and then we can backport the fixes to released distro such as jazzy
?
So, I retargeted this PR to the rolling branch, but it seems like there are some conflicts because my original branch was based on jazzy. Should I do a rebase, or would it be better to create a new branch and a new PR? |
@Mergifyio rebase |
☑️ Nothing to do
|
@pedroazeredo04 i tried to rebase by Mergifyio, but it did not work. yes, please rebase this to rolling branch. |
I recommend not doing a rebase, but instead cherry pick your commit on rolling. Afterwards force push to your branch for this pr. |
Signed-off-by: pedroazeredo04 <[email protected]> Signed-off-by: Pedro Nogueira <[email protected]>
78411a6
to
d3ccb3b
Compare
Nice, thanks a lot @fujitatomoya and @jmachowinski. At the end, I did the cherry pick and force push, it looks like it worked. I was a bit scared about the rebase, there were a lot of conflicts and I was worried about messing up something ahahaha |
Pulls: #2819 |
Test failure on Linux is unrelated |
Thanks for the PR @pedroazeredo04 |
@jmachowinski we are currently branching on freeze...? |
@Mergifyio backport jazzy |
✅ Backports have been created
|
Signed-off-by: pedroazeredo04 <[email protected]> Signed-off-by: Pedro Nogueira <[email protected]> (cherry picked from commit 8e49bef)
There was a message the rolling sync was done. Are we still on freeze? |
We're still in the freeze. The Rolling sync is for binary releases (related to rosdistro). |
That being said, this only changes a test and does fix an issue, so it's probably fine! |
Fix race condition in test clock (backport #2819)
This Pull Request intends to fix the issue #2804
In order to do so, I first ran helgrind on the code, and found that there existed a race condition in a vector of booleans. Afterwards, I changed this vector to
std::atomic_bool
. With that, I ran the helgrind again, and found there was no more race condition.This is the full log of helgrind for the original code.
This is the full log of helgrind for the modified code.
Note that, since they are the full log of the helgrind, in both of these snippets, there are some unrelated warnings. However, by searching for
data race
inside this logs, it is possible to see that they were corrected.This is my first Pull Request, so if there are any changes I still have to do, please let me know.
(Edit: I just realized my signature in the commit was wrong. I believe I have corrected it, hopefully everything is OK now)