contrail-collector crash immediately after provisioning
root cause:
To state_machine_, sandesh_connection is owner as scoped_ptr.
generator as user use state_machine_.get() to access. sandesh
_connection will deal with connection close message in one core
but generator will deal with redis message in another core. This
lead source race condition. We have use mutex lock to protect.
but mutex is one part of state_machine_ structure, so to
destructed fucntion of state_machine_, protecting is invalid.
Solution:
Change scoped_ptr to shared_ptr.
Reviewed: https:/ /review. opencontrail. org/41242 github. com/Juniper/ contrail- sandesh/ commit/ bbfbb6a5978f516 7702cad8ae7a49c 80c6630a35
Committed: http://
Submitter: Zuul (<email address hidden>)
Branch: R3.2
commit bbfbb6a5978f516 7702cad8ae7a49c 80c6630a35
Author: zcui <email address hidden>
Date: Fri Mar 30 08:54:16 2018 -0700
contrail-collector crash immediately after provisioning
root cause: .get() to access. sandesh
To state_machine_, sandesh_connection is owner as scoped_ptr.
generator as user use state_machine_
_connection will deal with connection close message in one core
but generator will deal with redis message in another core. This
lead source race condition. We have use mutex lock to protect.
but mutex is one part of state_machine_ structure, so to
destructed fucntion of state_machine_, protecting is invalid.
Solution:
Change scoped_ptr to shared_ptr.
Change-Id: I1756f8dc0cdd1e 7b705af9f1650c6 bb8b118e212
Partial-Bug: 1755649