osaf/libs/agents/saf/imma/imma_cb.h | 1 + osaf/libs/agents/saf/imma/imma_def.h | 1 + osaf/libs/agents/saf/imma/imma_oi_api.c | 23 ++++++++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletions(-)
IMMA uses IMMA_OI_CALLBACK_TIMEOUT for sending OI timeout to IMM service using implementer set operations. diff --git a/osaf/libs/agents/saf/imma/imma_cb.h b/osaf/libs/agents/saf/imma/imma_cb.h --- a/osaf/libs/agents/saf/imma/imma_cb.h +++ b/osaf/libs/agents/saf/imma/imma_cb.h @@ -71,6 +71,7 @@ typedef struct imma_client_node { * enviroment variable IMMA_MAX_OPEN_SEARCHES_PER_HANDLE */ uint32_t maxSearchHandles; uint32_t searchHandleSize; /* Number of open search handles */ + uint32_t oiTimeout; /* Timeout for OI callback. If the value is 0, the default timeout (6s) will be used */ } IMMA_CLIENT_NODE; /* Node to store adminOwner info */ diff --git a/osaf/libs/agents/saf/imma/imma_def.h b/osaf/libs/agents/saf/imma/imma_def.h --- a/osaf/libs/agents/saf/imma/imma_def.h +++ b/osaf/libs/agents/saf/imma/imma_def.h @@ -25,6 +25,7 @@ #define IMMA_MINOR_VERSION 0x0e #define IMMSV_WAIT_TIME 1000 /* Default MDS wait time in 10ms units =>10 sec*/ +#define IMMSV_OI_CALLBACK_WAIT_TIME 6 /* Default wait time for OI callback to reply in seconds => 6 sec*/ diff --git a/osaf/libs/agents/saf/imma/imma_oi_api.c b/osaf/libs/agents/saf/imma/imma_oi_api.c --- a/osaf/libs/agents/saf/imma/imma_oi_api.c +++ b/osaf/libs/agents/saf/imma/imma_oi_api.c @@ -139,6 +139,21 @@ SaAisErrorT saImmOiInitialize_2(SaImmOiH cl_node->syncr_timeout = IMMSV_WAIT_TIME; /* Default */ } + if((timeout_env_value = getenv("IMMA_OI_CALLBACK_TIMEOUT"))!=NULL) { + char *endp = NULL; + cl_node->oiTimeout = strtol(timeout_env_value, &endp, 10); + if(!endp || *endp) { + TRACE_2("Failed to parse IMMA_OI_CALLBACK_TIMEOUT. " + "OI timeout will be set to the default value: %u", + IMMSV_OI_CALLBACK_WAIT_TIME); + cl_node->oiTimeout = IMMSV_OI_CALLBACK_WAIT_TIME; + } else { + TRACE_2("IMMA library OI timeout set to:%u", cl_node->oiTimeout); + } + } else { + cl_node->oiTimeout = IMMSV_OI_CALLBACK_WAIT_TIME; + } + /* Take the CB Lock */ if (m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) { TRACE_4("ERR_LIBRARY: LOCK failed"); @@ -1276,11 +1291,17 @@ SaAisErrorT saImmOiImplementerSet(SaImmO /* Populate & Send the Open Event to IMMND */ memset(&evt, 0, sizeof(IMMSV_EVT)); evt.type = IMMSV_EVT_TYPE_IMMND; - evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET; evt.info.immnd.info.implSet.client_hdl = immOiHandle; evt.info.immnd.info.implSet.impl_name.size = nameLen; evt.info.immnd.info.implSet.impl_name.buf = implementerName; + if(cl_node->isImmA2d && cl_node->oiTimeout != IMMSV_OI_CALLBACK_WAIT_TIME) { + evt.info.immnd.info.implSet.oi_timeout = cl_node->oiTimeout; + evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET_2; + } else { + evt.info.immnd.type = IMMND_EVT_A2ND_OI_IMPL_SET; + } + /* Unlock before MDS Send */ m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE); locked = false; ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel