-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 data races in chip-tool on Darwin #7829
Fix data races in chip-tool on Darwin #7829
Conversation
84ba1ba
to
92802a6
Compare
…l commands. This makes Run() not take any arguments, which makes it easier to queue parts of it to run async.
Except init and shutdown.
92802a6
to
b87b8fc
Compare
@Damian-Nordic @jmartinez-silabs @andy31415 @mspang please take a look. Note that it's easier to review the individual changesets here than the whole thing at once. |
@@ -36,6 +36,7 @@ class DiscoverCommand : public Command, public chip::Controller::DeviceAddressUp | |||
|
|||
/////////// Command Interface ///////// | |||
CHIP_ERROR Run() override; | |||
uint16_t GetWaitDurationInSeconds() const override { return 30; } |
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, Just wondering about the different GetWaitDurationInSeconds
values here and in following command interfaces. How were they determined?
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.
@bzbarsky-apple can you follow up here?
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.
I kept the existing values, which I suspect were determined by "this should not take longer than, oh I guess this long" or so.
…HIP Tool commands
* Move the local and remote node ids into the exec context for chip-tool commands. This makes Run() not take any arguments, which makes it easier to queue parts of it to run async. * Switch SetCommandExitStatus to take a CHIP_ERROR argument * Regenerate generated code for SetCommandExitStatus changes * Change chip-tool to generally touch the stack only from a queued task. Except init and shutdown.
…idaiton; remove TimeReference, PeakPeriodStatus, PeakPeriodEndTime attributes validation based on PR project-chip#7829 Signed-off-by: Dmitry Maslov <[email protected]>
Problem
We have some remaining data races in chip-tool on Darwin.
Change overview
Queue the initial command
Run
method over to the CHIP thread so that all the work apart from initial setup and final teardown of the CHIP stack happens on that thread, avoiding races.Testing
Ran #7797 without this change (fails every time) and with this change (passes every time on Darwin).
Note that this change makes #7797 fail on Linux until #7828 is fixed.
Reviewer note: There are 4 changesets here; reviewing them separately is probably a lot easier than reviewing the whole thing all at once.