osaf/services/saf/amf/amfd/main.cc | 37 ++++++++++++++++++++++++++++++-------
1 files changed, 30 insertions(+), 7 deletions(-)
amfd needs to reinit with CLM if saClmDispatch() returns SA_AIS_ERR_BAD_HANDLE
diff --git a/osaf/services/saf/amf/amfd/main.cc
b/osaf/services/saf/amf/amfd/main.cc
--- a/osaf/services/saf/amf/amfd/main.cc
+++ b/osaf/services/saf/amf/amfd/main.cc
@@ -701,15 +701,38 @@ static void main_loop(void)
if (fds[FD_CLM].revents & POLLIN) {
TRACE("CLM event rec");
error = saClmDispatch(cb->clmHandle, SA_DISPATCH_ONE);
+ switch (error) {
+ case SA_AIS_OK:
+ /* commit async updated possibly sent
in the callback */
+ m_AVSV_SEND_CKPT_UPDT_SYNC(cb,
NCS_MBCSV_ACT_UPDATE, 0);
- if (error != SA_AIS_OK)
- LOG_ER("main: saClmDispatch FAILED %u", error);
+ /* flush messages possibly queued in
the callback */
+ avd_d2n_msg_dequeue(cb);
+ break;
+
+ case SA_AIS_ERR_BAD_HANDLE:
+ if (avd_clm_init() != SA_AIS_OK) {
+ LOG_EM("avd_clm_init FAILED");
+ osafassert(false);
+ }
- /* commit async updated possibly sent in the callback */
- m_AVSV_SEND_CKPT_UPDT_SYNC(cb, NCS_MBCSV_ACT_UPDATE, 0);
-
- /* flush messages possibly queued in the callback */
- avd_d2n_msg_dequeue(cb);
+ // restart CLM tracking if we are active
+ SaAmfHAStateT role;
+ if (rda_get_role(&role) !=
NCSCC_RC_SUCCESS) {
+ LOG_ER("rda_get_role FAILED");
+ osafassert(false);
+ }
+ if (role == SA_AMF_HA_ACTIVE) {
+ if (avd_clm_track_start() !=
SA_AIS_OK) {
+
LOG_ER("avd_clm_track_start FAILED");
+ osafassert(false);
+ }
+ }
+ break;
+ default:
+ LOG_ER("main: saClmDispatch FAILED %u",
error);
+ osafassert(false);
+ }
}
if (cb->immOiHandle && fds[FD_IMM].revents & POLLIN) {
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel