Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contrail-collector crash immediately after provisioning
root cause: Race condition problem: To state_machine_, (1) alloced by sandesh_connection. (2) used by generator When problem happen, generator receive Resource update message, and enqueue resouece update to state_machine_, at same time, update stats immedietly. This action will try to get mutex sometime, it will lead CPU yield. We call this as thread 1. At same time, connection close is triggered, and destructor function will be triggered. And destructure will call termial and all memory will be released related to this connection. We call this as thread 2. When thread 2 finished and thread 1 go ahead, crash will happen. Solution: Designer of state_machine should consider this problem. So state Machine destructure is separated two steps: (1) call terminal to free memory alloced by its substruct. (2) start a timer to free state machine self. Between step1 and step2, deleted_ is used to check state machine can be used or not. We add a shutdown fucntion for stats structure to pass this state. Closes-Bug: 1755649 Change-Id: I599461f0a37adc21d2b68a5ca20d66ccaf4f6e51
- Loading branch information
1 parent
f4e9036
commit 3be6ccb
Showing
3 changed files
with
31 additions
and
2 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