Thanks Praveen. I will remove ` SA_AIS_ERR_UNAVAILABLE` error code checking.
Regards, Vu > -----Original Message----- > From: praveen malviya [mailto:praveen.malv...@oracle.com] > Sent: Thursday, November 17, 2016 4:07 PM > To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; > minh.c...@dektech.com.au > Cc: opensaf-devel@lists.sourceforge.net > Subject: Re: [PATCH 1 of 1] ntf: handle error code TRY_AGAIN of > saClmInitialize() [#2191] > > Hi Vu, > > Please find query inline [Praveen]. > > Thanks, > Praveen > > On 17-Nov-16 11:58 AM, Vu Minh Nguyen wrote: > > osaf/services/saf/ntfsv/ntfs/ntfs_clm.c | 14 +++++++++++++- > > 1 files changed, 13 insertions(+), 1 deletions(-) > > > > > > NTF did not deal with TRY_AGAIN error code of `saClmInitialize()`, > > NTF would exit, and cause node reboot if getting TRY_AGAIN. > > > > The patch adds a while loop to do retry when getting TRY_AGAIN. > > > > diff --git a/osaf/services/saf/ntfsv/ntfs/ntfs_clm.c > b/osaf/services/saf/ntfsv/ntfs/ntfs_clm.c > > --- a/osaf/services/saf/ntfsv/ntfs/ntfs_clm.c > > +++ b/osaf/services/saf/ntfsv/ntfs/ntfs_clm.c > > @@ -101,13 +101,25 @@ void *ntfs_clm_init_thread(void *cb) > > { > > ntfs_cb_t *_ntfs_cb = (ntfs_cb_t *) cb; > > SaAisErrorT rc = SA_AIS_OK; > > + uint32_t msecs_waited = 0; > > + const uint32_t max_waiting_time_10s = 10 * 1000; /* 10 secs */ > > + > > TRACE_ENTER(); > > + > > rc = saClmInitialize_4(&_ntfs_cb->clm_hdl, &clm_callbacks, > &clmVersion); > > + while (((rc == SA_AIS_ERR_TRY_AGAIN) || (rc == > SA_AIS_ERR_TIMEOUT) || > > + (rc == SA_AIS_ERR_UNAVAILABLE)) && > [Praveen] Based on discussion on ticket #1828 related to CLM > initialization, I remember this API does not return ERR_UNAVAILABLE even > on a CLM locked node also. This provision is to enable application on > CLM locked node to perform tracking of CLM status of nodes. > > But I think even CLM Agent can return this code when CLMS server has not > got node related information from CLM agent and in that case CLMS will > return ERR_UNAVAILABLE. If it is not so, then I think we are not > required to handle rc == SA_AIS_ERR_UNAVAILABLE. > > Thanks, > Praveen > > + (msecs_waited < max_waiting_time_10s)) { > > + usleep(100*1000); > > + msecs_waited += 100; > > + rc = saClmInitialize_4(&_ntfs_cb->clm_hdl, &clm_callbacks, > &clmVersion); > > + } > > if (rc != SA_AIS_OK) { > > LOG_ER("saClmInitialize failed with error: %d", rc); > > TRACE_LEAVE(); > > - exit(EXIT_FAILURE); > > + exit(EXIT_FAILURE); > > } > > + > > rc = saClmSelectionObjectGet(_ntfs_cb->clm_hdl, &ntfs_cb- > >clmSelectionObject); > > if (rc != SA_AIS_OK) { > > LOG_ER("saClmSelectionObjectGet failed with error: %d", > rc); > > ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel