samples/amf/sa_aware/amf_demo.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
The amf_demo sample crashes if shutdown SU due to NULL csiName, which comes
from a TARGET_ALL csi_callback.
The #1437 raised for 2 points:
.1: Fix amf_demo crahes
.2: Verify the ha transition in csi lifecycle
This patch is for point .1, which avoid the crash. It leaves a note that real
application should make sure its service successfully being moved to QUIESCED
after saAmfCSIQuiescingComplete.
Another patch has been made for point .2, that actually checks all csi(s) being
moved to QUIESCED and also verify the ha transition in csi lifecycle. This patch
seems to make amf_demo becoming a test program rather than an abstract sample,
so
it's only attached to for testing, not for commit.
diff --git a/samples/amf/sa_aware/amf_demo.c b/samples/amf/sa_aware/amf_demo.c
--- a/samples/amf/sa_aware/amf_demo.c
+++ b/samples/amf/sa_aware/amf_demo.c
@@ -166,11 +166,19 @@ static void amf_csi_set_callback(SaInvoc
syslog(LOG_ERR, "saAmfCSIQuiescingComplete FAILED -
%u", rc);
exit(1);
}
+ if (csi_desc.csiFlags == SA_AMF_CSI_TARGET_ONE) {
+ rc = saAmfHAStateGet(my_amf_hdl, comp_name,
&csi_desc.csiName, &my_ha_state);
+ if (rc != SA_AIS_OK) {
+ syslog(LOG_ERR, "saAmfHAStateGet FAILED - %u",
rc);
+ exit(1);
+ }
+ } else if (csi_desc.csiFlags == SA_AMF_CSI_TARGET_ALL) {
+ // Application could iterate saAmfHAStateGet() for
every csi
+ // which had been assigned to this component to ensure
+ // all csi(s) are QUIESCED
- rc = saAmfHAStateGet(my_amf_hdl, comp_name, &csi_desc.csiName,
&my_ha_state);
- if (rc != SA_AIS_OK) {
- syslog(LOG_ERR, "saAmfHAStateGet FAILED - %u", rc);
- exit(1);
+ // temporary set to QUIESCED
+ my_ha_state = SA_AMF_HA_QUIESCED;
}
syslog(LOG_INFO, "My HA state is %s",
ha_state_name[my_ha_state]);
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel