Hi I would like to push this patch on Friday if there are no objections.
For the medium term, we should consider making AMFND an applier to avoid these issues? Thanks Gary On 15/6/17, 5:41 pm, "Gary Lee" <gary....@dektech.com.au> wrote: On a congested network, sometimes a newly created IMM object can take some time to be available on other nodes. In our test, a new SU is created on SC-1 and unlocked. But sometimes it fails on a remote node due to: 2017-05-19 13:55:19 SC-2 osafamfnd[258]: ER amf_saImmOmSearchInitialize_o2 failed: 12 To get around this, we will retry on SA_AIS_ERR_NOT_EXIST a few times. --- src/amf/amfnd/util.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/amf/amfnd/util.cc b/src/amf/amfnd/util.cc index ed0905ce2..bca642eac 100644 --- a/src/amf/amfnd/util.cc +++ b/src/amf/amfnd/util.cc @@ -38,6 +38,9 @@ #include <unistd.h> #include "osaf/configmake.h" #include "amf/amfnd/avnd.h" +#include "base/osaf_time.h" + +extern struct ImmutilWrapperProfile immutilWrapperProfile; const char *presence_state[] = { "OUT_OF_RANGE", "UNINSTANTIATED", "INSTANTIATING", @@ -335,6 +338,18 @@ SaAisErrorT amf_saImmOmSearchInitialize_o2( scope, searchOptions, searchParam, attributeNames, &searchHandle); } + } else if (rc == SA_AIS_ERR_NOT_EXIST) { + // it is possible for 'rootName' to be not yet available + // at the local immnd. Retry a few times to allow CCB to be propagated. + unsigned int nTries = 1; + while (rc == SA_AIS_ERR_NOT_EXIST && + nTries < immutilWrapperProfile.nTries) { + osaf_nanosleep(&kHundredMilliseconds); + rc = immutil_saImmOmSearchInitialize_o2(immHandle, rootName.c_str(), + scope, searchOptions, searchParam, + attributeNames, &searchHandle); + nTries++; + } } return rc; } -- 2.11.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel