Dear Mahesh,

I find no problem so
ACK from me.

Does it really need to change the timeout value here?

Thank you and best regards,
Hoang

-----Original Message-----
From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com] 
Sent: Monday, September 19, 2016 12:47 PM
To: hoang.m...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] cpa: provide support for full range of timeout for
CkptSynchronize API [#2044]

 osaf/libs/agents/saf/cpa/cpa_api.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)


saCkptCheckpointSynchronize() API  functions that take an explicit timeout
parameter are currently expect the user to always set this parameter to MIN
timeout value.

Now this patch  implements support for the  full range of timeout values
i.e. [0, SA_TIME_MAX] , since the underlying POSIX functions do support
them.

diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c
b/osaf/libs/agents/saf/cpa/cpa_api.c
--- a/osaf/libs/agents/saf/cpa/cpa_api.c
+++ b/osaf/libs/agents/saf/cpa/cpa_api.c
@@ -4114,7 +4114,12 @@ SaAisErrorT saCkptCheckpointSynchronize(
                                SA_AIS_ERR_INVALID_PARAM, checkpointHandle);
                rc =SA_AIS_ERR_INVALID_PARAM;
                goto done;
-       }
+       } else if (timeout > (SA_TIME_ONE_MILLISECOND *
MDS_MAX_TIMEOUT_MILLISECOND)) {
+               TRACE_4("Cpa CkptSynchronize: timeout > MDS_MAX_TIMEOUT
setting to MDS max timeout value:%lld,ckptHandle:%llx",
+                               (SA_TIME_ONE_MILLISECOND *
MDS_MAX_TIMEOUT_MILLISECOND), ckptHandle);
+               timeout = (SA_TIME_ONE_MILLISECOND *
MDS_MAX_TIMEOUT_MILLISECOND);
+       }
+
 
        /* retrieve CPA CB */
        m_CPA_RETRIEVE_CB(cb);
@@ -4202,12 +4207,6 @@ SaAisErrorT saCkptCheckpointSynchronize(
        /* Convert the time from saTimeT to millisecs */
        timeout = m_CPSV_CONVERT_SATIME_TEN_MILLI_SEC(timeout);
 
-       if (timeout < CPSV_WAIT_TIME) {
-               rc = SA_AIS_ERR_TIMEOUT;
-               TRACE_4("cpa CkptSynchronize Api failed with return
value:%d,ckptHandle:%llx ", rc, checkpointHandle);
-               goto fail1;
-       }
-
        m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE);
 
        proc_rc = cpa_mds_msg_sync_send(cb->cpa_mds_hdl,
&(gc_node->active_mds_dest), &evt, &out_evt, timeout);


------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to