-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[component_manager] Fix destroy/create race
This fixes a bug in component manager that can cause a created component to be incorrectly deleted if it was created just after another component with the same name was deleted. To be precise, the race is as follows: 1) Client calls DestroyChild. 2) component_manager schedules a DeleteChild action 3) DestroyChild returns. 4) Client calls CreateChild, with the same instance name. 5) Instance is created. 6) The DeleteChild action from #2 executes. It starts by scheduling a MarkDeleted action, which incorrectly marks the new instance deleted. The solution is for DeleteChild not to call MarkDeleted. Instead, code that handles instance destruction must explicitly call MarkDeleted first. This bug was causing `ffx session restart` to sometimes error with CreateComponentFailed (which actually was an error of failing to bind to the session component). Tested: Manually verified the fix works with `session_control`. Added an integration test which should flake if the issue is present. Unit test checks that MarkDeleted is not rescheduled. Multiply: destruction_integration_test: 200 Fixed: 41967 Change-Id: I1f19811b0afff0533a2721b45fe7cc07bde072ce Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/511284 Commit-Queue: Gary Bressler <geb@google.com> Reviewed-by: Fady Samuel <fsamuel@google.com>
- Loading branch information
1 parent
d4118f9
commit 7a9ff48
Showing
15 changed files
with
345 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.