The code that was pushed is not backwards compatible. Here is an example of a 
program that used to work, but no longer works after this code was pushed:


~~~~
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "saCkpt.h"

static SaCkptCheckpointCreationAttributesT
checkpointCreationAttributes = {
  SA_CKPT_WR_ACTIVE_REPLICA,
  512,
  SA_TIME_ONE_MINUTE,
  40,
  100,
  700
};

int main(void) {
  SaCkptHandleT ckptHandle;
  SaAisErrorT err;
  SaCkptCheckpointHandleT checkpointHandle;
  SaVersionT version = { 'B', 0x02, 0x00 };
  if (saCkptInitialize(&ckptHandle, NULL, &version) != SA_AIS_OK) {
      printf("FAILED to initialize CKPT handle\n");
      return 1;
  }
  const SaNameT checkpointName = {strlen("safCkpt=hello"), "safCkpt=hello"};
  do {
    err = saCkptCheckpointOpen(
        ckptHandle,
        &checkpointName,
        &checkpointCreationAttributes,
        SA_CKPT_CHECKPOINT_READ |
        SA_CKPT_CHECKPOINT_WRITE |
        SA_CKPT_CHECKPOINT_CREATE,
        10 * SA_TIME_ONE_SECOND,
        &checkpointHandle);
    if (err != SA_AIS_OK) printf("saCkptCheckpointOpen failed %d\n", (int) err);
    usleep(100000);
  } while (err == SA_AIS_ERR_TRY_AGAIN || err == SA_AIS_ERR_TIMEOUT);
  if (err == SA_AIS_OK) {
      printf("Checkpoint sucessfully opened\n");
      return 0;
  } else {
      printf("FAILED to open checkpoint\n");
      return 1;
  }
}
~~~~


---

** [tickets:#1583] cpsv :  saCkptCheckpointOpen open doesn't return if timeout 
value is below the default CPSV_WAIT_TIME**

**Status:** fixed
**Milestone:** 4.6.2
**Created:** Wed Nov 04, 2015 04:40 AM UTC by A V Mahesh (AVM)
**Last Updated:** Thu Nov 12, 2015 10:16 AM UTC
**Owner:** A V Mahesh (AVM)


If we test upper & lower limits of `SaTimeT timeout`  arguments to CPSV API  , 
some of CPA API`s are doesn't returns
 
Current cpa code-doesn't   validating/passing  `SaTimeT timeout`  arguments to 
CPSV API  , which are  below  default API timeout limit  of  CPSV_WAIT_TIME 
(1400 * 10ms)  and above  `SaTimeT`,  type long long int Maximum value  
9223372036854775807 (2^63-1)

For example :

      i)     const SaTimeT timeout = 1215752192;    
      ii)     const SaTimeT timeout = 2 * SA_TIME_ONE_MINUTE;
      iii)     const SaTimeT timeout = 9223372036854775809;

        saCkptCheckpointOpen(....,   timeout, ...);

Because of that in some of variables are over flowing and , API   calls are not 
working properly


Solution  :

1 - need to validate   if (time_out < CPSV_WAIT_TIME)   return   
SA_AIS_ERR_INVALID_PARAM

2-  need to validate if (expirationTime < 0 )  return   SA_AIS_ERR_INVALID_PARAM

3-  Pass proper timeout values to   internal functions of Opensaf 


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to