osaf/services/saf/amf/amfnd/compdb.cc |   3 ++-
 osaf/services/saf/amf/amfnd/susm.cc   |  16 ++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)


If immnd is down for an extended period of time, amfnd can be killed by the AMF 
watchdog
as it's stuck in immutil_saImmOmInitialize(). This can happen if a non OpenSAF 
component
restarts during this period.

saImmOmInitialize already has a potential timeout of 30s, and if we call 
saImmOmInitialize()
in a loop as we do in immutil_saImmOmInitialize() then a watchdog timeout is 
likely to be
triggered.

diff --git a/osaf/services/saf/amf/amfnd/compdb.cc 
b/osaf/services/saf/amf/amfnd/compdb.cc
--- a/osaf/services/saf/amf/amfnd/compdb.cc
+++ b/osaf/services/saf/amf/amfnd/compdb.cc
@@ -1827,9 +1827,10 @@ unsigned int avnd_comp_config_get_su(AVN
 
        TRACE_ENTER2("SU'%s'", su->name.value);
 
-       error = saImmOmInitialize_cond(&immOmHandle, nullptr, &immVersion);
+       error = saImmOmInitialize(&immOmHandle, nullptr, &immVersion);
        if (error != SA_AIS_OK) {
                LOG_CR("saImmOmInitialize failed: %u", error);
+               rc = NCSCC_RC_OUT_OF_MEM;
                goto done;
        }
        searchParam.searchOneAttr.attrName = 
const_cast<SaImmAttrNameT>("SaImmAttrClassName");
diff --git a/osaf/services/saf/amf/amfnd/susm.cc 
b/osaf/services/saf/amf/amfnd/susm.cc
--- a/osaf/services/saf/amf/amfnd/susm.cc
+++ b/osaf/services/saf/amf/amfnd/susm.cc
@@ -1356,17 +1356,17 @@ uint32_t avnd_evt_avd_su_pres_evh(AVND_C
                   Fix for the above problem is that Middleware Components wont 
be dynamically added in the case 
                   of openSAF SUs, so don't refresh config info if it is 
openSAF SU. */
 
-               if ((false == su->is_ncs) && (avnd_comp_config_get_su(su) != 
NCSCC_RC_SUCCESS)) {
-                       if (cb->scs_absence_max_duration == 0) {
-                                m_AVND_SU_REG_FAILED_SET(su);
+               if ((false == su->is_ncs) && ((rc = 
avnd_comp_config_get_su(su)) != NCSCC_RC_SUCCESS)) {
+                       if (rc == NCSCC_RC_OUT_OF_MEM && su->comp_list.n_nodes 
> 0) {
+                               // @todo this is a temporary workaround: IMM is 
not accepting OM connections
+                               // and a SU needs to be restarted.
+                               LOG_CR("'%s': failed to refresh components in 
SU. Attempt to reuse old config", __FUNCTION__);
+                       } else {
+                               m_AVND_SU_REG_FAILED_SET(su);
                                /* Will transition to instantiation-failed when 
instantiated */
                                LOG_ER("'%s':FAILED", __FUNCTION__);
                                rc = NCSCC_RC_FAILURE;
-                       goto done;
-                       } else {
-                               // @TODO(garylee) this is a temporary 
workaround: IMM is not accepting OM connections
-                               // and a component needs to be restarted.
-                               LOG_CR("'%s': failed to refresh components in 
SU. Attempt to reuse old config", __FUNCTION__);
+                               goto done;
                        }
                }
                /* trigger su instantiation for pi su */

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to