|
From: Michael Chase-S. <mc...@us...> - 2012-02-04 01:03:33
|
Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv21993
Modified Files:
ChangeLog NEWS indCIMXMLHandler.c interopProvider.c
sfcb.cfg.pre.in
Log Message:
3484025 Disable indication sequencing
Index: NEWS
===================================================================
RCS file: /cvsroot/sblim/sfcb/NEWS,v
retrieving revision 1.629
retrieving revision 1.630
diff -u -d -r1.629 -r1.630
--- NEWS 3 Feb 2012 16:45:57 -0000 1.629
+++ NEWS 4 Feb 2012 01:03:30 -0000 1.630
@@ -8,6 +8,7 @@
- 3435778 Preserve leading/trailing whitespace in values
- 3433733 CreationClassNames should be supplied
- 3446179 Add a feature to validate CMPI types
+- 3484025 Disable indication sequencing
Bugs fixed:
Index: indCIMXMLHandler.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/indCIMXMLHandler.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- indCIMXMLHandler.c 27 Jan 2012 02:33:15 -0000 1.41
+++ indCIMXMLHandler.c 4 Feb 2012 01:03:30 -0000 1.42
@@ -60,6 +60,8 @@
}
return 1;
}
+
+int RIEnabled=-1;
/* ------------------------------------------------------------------ *
* Instance MI Cleanup
@@ -375,6 +377,8 @@
strftime(gtime, 15, "%Y%m%d%H%M%S", &cttm);
}
+ // Even though reliable indications may be disabled, we need to do this
+ // in case it ever gets enabled.
// Get the IndicationService name
CMPIObjectPath * isop = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", NULL);
CMPIEnumeration * isenm = _broker->bft->enumerateInstances(_broker, ctx, isop, NULL, NULL);
@@ -846,53 +850,60 @@
if (interOpNameSpace(ref,&st)==0) _SFCB_RETURN(st);
if (strcasecmp(methodName, "_deliver") == 0) {
-
- // Set the indication sequence values
+ // On the first indication, check if reliable indications are enabled.
+ if (RIEnabled == -1) {
+ CMPIObjectPath *op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",NULL);
+ CMPIEnumeration *isenm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL);
+ CMPIData isinst=CMGetNext(isenm,NULL);
+ CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL);
+ RIEnabled=mc.value.uint16;
+ }
CMPIInstance *indo=CMGetArg(in,"indication",NULL).value.inst;
CMPIInstance *ind=CMClone(indo,NULL);
- CMPIObjectPath * iop=CMGetObjectPath(ind,NULL);
- CMPIInstance *sub=CMGetArg(in,"subscription",NULL).value.inst;
- CMPIObjectPath * subop=CMGetObjectPath(sub,NULL);
- CMPIData handler=CMGetProperty(sub, "Handler", &st);
- CMPIObjectPath *hop=handler.value.ref;
- CMPIContext *ctxLocal = prepareUpcall((CMPIContext *) ctx);
- CMPIInstance *hdlr=CBGetInstance(_broker, ctxLocal, hop, NULL, &st);
- CMAddKey(iop,"SFCB_IndicationID",&indID,CMPI_uint32);
- CMSetProperty(ind,"SFCB_IndicationID",&indID,CMPI_uint32);
+ CMPIContext *ctxLocal=NULL;
+ CMPIObjectPath *iop=NULL,*subop=NULL;
+ CMPIInstance *sub=NULL;
- // Build the complete sequence context
- // Get the stub from the handler
- CMPIString *context = CMGetProperty(hdlr, "SequenceContext", &st).value.string;
- // and add the sfcb start time
- char *cstr=malloc( (strlen(context->ft->getCharPtr(context,NULL)) + strlen(sfcBrokerStart) + 1) * sizeof(char));
- sprintf(cstr,"%s%s",context->ft->getCharPtr(context,NULL),sfcBrokerStart);
- context = sfcb_native_new_CMPIString(cstr, NULL, 0);
- // and put it in the indication
- CMSetProperty(ind, "SequenceContext", &context, CMPI_string);
- free(cstr);
- CMRelease(context);
+ if (RIEnabled) {
+ ctxLocal = prepareUpcall((CMPIContext *) ctx);
+ // Set the indication sequence values
+ iop=CMGetObjectPath(ind,NULL);
+ CMAddKey(iop,"SFCB_IndicationID",&indID,CMPI_uint32);
+ CMSetProperty(ind,"SFCB_IndicationID",&indID,CMPI_uint32);
+ sub=CMGetArg(in,"subscription",NULL).value.inst;
+ CMPIData handler=CMGetProperty(sub, "Handler", &st);
+ CMPIObjectPath *hop=handler.value.ref;
+ CMPIInstance *hdlr=CBGetInstance(_broker, ctxLocal, hop, NULL, &st);
+
+ // Build the complete sequence context
+ // Get the stub from the handler
+ CMPIString *context = CMGetProperty(hdlr, "SequenceContext", &st).value.string;
+ // and add the sfcb start time
+ char *cstr=malloc( (strlen(context->ft->getCharPtr(context,NULL)) + strlen(sfcBrokerStart) + 1) * sizeof(char));
+ sprintf(cstr,"%s%s",context->ft->getCharPtr(context,NULL),sfcBrokerStart);
+ context = sfcb_native_new_CMPIString(cstr, NULL, 0);
+ // and put it in the indication
+ CMSetProperty(ind, "SequenceContext", &context, CMPI_string);
+ free(cstr);
+ CMRelease(context);
- // Get the proper sequence number
- CMPIValue lastseq = CMGetProperty(hdlr, "LastSequenceNumber", &st).value;
- lastseq.sint64++;
- // Handle wrapping of the signed int
- if (lastseq.sint64 < 0) lastseq.sint64=0;
- // Update the last used number in the handler
- CMSetProperty(hdlr, "LastSequenceNumber", &lastseq.sint64, CMPI_sint64);
- CBModifyInstance(_broker, ctxLocal, hop, hdlr, NULL);
- // And the indication
- CMSetProperty(ind, "SequenceNumber", &lastseq, CMPI_sint64);
+ // Get the proper sequence number
+ CMPIValue lastseq = CMGetProperty(hdlr, "LastSequenceNumber", &st).value;
+ lastseq.sint64++;
+ // Handle wrapping of the signed int
+ if (lastseq.sint64 < 0) lastseq.sint64=0;
+ // Update the last used number in the handler
+ CMSetProperty(hdlr, "LastSequenceNumber", &lastseq.sint64, CMPI_sint64);
+ CBModifyInstance(_broker, ctxLocal, hop, hdlr, NULL);
+ // And the indication
+ CMSetProperty(ind, "SequenceNumber", &lastseq, CMPI_sint64);
+ }
// Now send the indication
st = deliverInd(ref, in, ind);
if (st.rc != 0) {
- // Get the retry params from IndService
- CMPIObjectPath *op=CMNewObjectPath(_broker,"root/interop","CIM_IndicationService",NULL);
- CMPIEnumeration *isenm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, NULL);
- CMPIData isinst=CMGetNext(isenm,NULL);
- CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL);
- if (mc.value.uint16 > 0) {
+ if (RIEnabled){
_SFCB_TRACE(1,("--- Indication delivery failed, adding to retry queue"));
// Indication delivery failed, send to retry queue
// build an element
@@ -900,6 +911,7 @@
element = (RTElement *) malloc(sizeof(*element));
element->ref=ref->ft->clone(ref,NULL);
// Get the OP of the subscription and indication
+ subop=CMGetObjectPath(sub,NULL);
element->sub=subop->ft->clone(subop,NULL);
element->ind=iop->ft->clone(iop,NULL);
// Store other attrs
@@ -924,9 +936,9 @@
CMPIContext * pctx = native_clone_CMPIContext(ctx);
pthread_create(&t, &tattr,&retryExport,(void *) pctx);
}
+ CMRelease(ctxLocal);
}
}
- CMRelease(ctxLocal);
CMRelease(ind);
}
else {
Index: sfcb.cfg.pre.in
===================================================================
RCS file: /cvsroot/sblim/sfcb/sfcb.cfg.pre.in,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- sfcb.cfg.pre.in 23 Nov 2011 03:24:00 -0000 1.29
+++ sfcb.cfg.pre.in 4 Feb 2012 01:03:31 -0000 1.30
@@ -264,6 +264,8 @@
## Number of retry attempts before giving up
## Default is 3 attempts (not including initial attempt)
## A value of 0 disables reliable indications
+## including indication sequence numbers and subscription
+## removal.
#DeliveryRetryAttempts: 3
## The length of time an destination can fail before the subscription
Index: interopProvider.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/interopProvider.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- interopProvider.c 27 Jan 2012 02:33:15 -0000 1.49
+++ interopProvider.c 4 Feb 2012 01:03:31 -0000 1.50
@@ -652,6 +652,12 @@
CMRelease(enm);
}
+ CMPIObjectPath *isop=CMNewObjectPath(broker,"root/interop","CIM_IndicationService",NULL);
+ CMPIEnumeration *isenm = broker->bft->enumerateInstances(broker, ctx, isop, NULL, NULL);
+ CMPIData isinst=CMGetNext(isenm,NULL);
+ CMPIData mc=CMGetProperty(isinst.value.inst,"DeliveryRetryAttempts",NULL);
+ int RIEnabled=mc.value.uint16;
+
_SFCB_TRACE(1,("--- checking for cim_listenerdestination"));
op=CMNewObjectPath(broker,"root/interop","cim_listenerdestination",&st);
enm = _broker->bft->enumerateInstances(_broker, ctx, op, NULL, &st);
@@ -659,11 +665,14 @@
if(enm) {
while(enm->ft->hasNext(enm, &st) && (ci=(enm->ft->getNext(enm, &st)).value.inst)) {
cop=CMGetObjectPath(ci,&st);
- // Reset the sequence numbers on sfcb restart
- CMPIInstance *ldi = _broker->bft->getInstance(_broker, ctxLocal, cop, NULL, NULL);
- CMPIValue zarro = {.sint64 = -1 };
- CMSetProperty(ldi, "LastSequenceNumber", &zarro, CMPI_sint64);
- CBModifyInstance(_broker, ctxLocal, cop, ldi, NULL);
+
+ if (RIEnabled) {
+ // Reset the sequence numbers on sfcb restart
+ CMPIInstance *ldi = _broker->bft->getInstance(_broker, ctxLocal, cop, NULL, NULL);
+ CMPIValue zarro = {.sint64 = -1 };
+ CMSetProperty(ldi, "LastSequenceNumber", &zarro, CMPI_sint64);
+ CBModifyInstance(_broker, ctxLocal, cop, ldi, NULL);
+ }
addHandler(ci,cop);
}
CMRelease(enm);
Index: ChangeLog
===================================================================
RCS file: /cvsroot/sblim/sfcb/ChangeLog,v
retrieving revision 1.706
retrieving revision 1.707
diff -u -d -r1.706 -r1.707
--- ChangeLog 3 Feb 2012 16:45:57 -0000 1.706
+++ ChangeLog 4 Feb 2012 01:03:30 -0000 1.707
@@ -1,3 +1,8 @@
+2012-02-03 Michael Chase-Salerno <br...@li...>
+
+ * interopProvider.c, indCIMXMLHandler.c, sfcb.cfg.pre.in
+ [ 3484025 ] Disable indication sequencing
+
2012-02-03 Chris Buccella <buc...@li...>
* profileProvider.c, providerMgr.c, default.reg.in, configure.ac,
|