Clearing service instance DB State after STOP command
If Delete of service instance is received before it was marked
unusable, to stop the namespace, StopServiceInstance command is issued,
which invokes the deletion of the namespace script. And immediately after
this, DB state is cleared. Clearing of DB State can result in deleting
of service instance DBEntry before namespace script completion. SIGCHILD
event after script completion looks for service instance that triggered the
task, and results in crash as the service isntance is already deleted.
To avoid crash, the DBState is cleared after processing the SIGCHILD
event. Also corresponding to the service instance, there can be many
tasks queued for execution. To identify how any SIGCHILDS to wait for,
running tasks cound is maintained in DBState. This could is manipulated
everytime the task is created, destroyed, error handled corresponding to
the service instance.
Reviewed: https:/ /review. opencontrail. org/10961 github. org/Juniper/ contrail- controller/ commit/ abdb26d0b61b759 089b3572648394d 16413e06ee
Committed: http://
Submitter: Zuul
Branch: R2.20
commit abdb26d0b61b759 089b3572648394d 16413e06ee
Author: Divakar <email address hidden>
Date: Wed May 27 20:59:31 2015 -0700
Clearing service instance DB State after STOP command
If Delete of service instance is received before it was marked
unusable, to stop the namespace, StopServiceInstance command is issued,
which invokes the deletion of the namespace script. And immediately after
this, DB state is cleared. Clearing of DB State can result in deleting
of service instance DBEntry before namespace script completion. SIGCHILD
event after script completion looks for service instance that triggered the
task, and results in crash as the service isntance is already deleted.
To avoid crash, the DBState is cleared after processing the SIGCHILD
event. Also corresponding to the service instance, there can be many
tasks queued for execution. To identify how any SIGCHILDS to wait for,
running tasks cound is maintained in DBState. This could is manipulated
everytime the task is created, destroyed, error handled corresponding to
the service instance.
Testcases to follow in the next commit
Change-Id: I4b9853de271b8e e54016bb91b7a2e 199cbce6b0d
closes-bug: #1449166
closes-bug: #1453956