Re: [devel] [PATCH 0 of 3] Review Request for amf: Fix all Cppcheck 1.77 issues [#2341] V1

2017-03-09 Thread A V Mahesh
Hi Gary,

Thanks for the initial inputs.

The patch doesn't contain any in-service /backward compatible change , 
just wondering
how this patch broken the  legacy Application , can you please 
code-snippet of your legacy Application,
that breaking the patch.

-AVM

On 3/10/2017 10:59 AM, Gary Lee wrote:
> Hi Mahesh
>
> Some of our legacy tests are failing after applying this series.
>
> I will do some debugging and send back details.
>
> Thanks
> Gary
>
> -Original Message-
> From: A V Mahesh 
> Date: Wednesday, 8 March 2017 at 11:28 pm
> To: , gary , 
> , 
> Cc: 
> Subject: [PATCH 0 of 3] Review Request for amf: Fix all Cppcheck 1.77 issues 
> [#2341] V1
>
>  Summary:amf: Fix all Cppcheck 1.77 issues [#2341] V1
>  Review request for Trac Ticket(s): #2341
>  Peer Reviewer(s): Amf Dev
>  Pull request to: <>
>  Affected branch(es): default, 5.2
>  Development branch: default
>  
>  
>  Impacted area   Impact y/n
>  
>   Docsn
>   Build systemn
>   RPM/packaging   n
>   Configuration files n
>   Startup scripts n
>   SAF servicesn
>   OpenSAF servicesy
>   Core libraries  n
>   Samples n
>   Tests   n
>   Other   n
>  
>  
>  Comments (indicate scope for each "y" above):
>  -
>  
>  changeset b8e7593cf4eadaa6169fe635ac0df67560ea875a
>  Author:  A V Mahesh 
>  Date:Wed, 08 Mar 2017 17:52:21 +0530
>  
>   amfd: Fix all Cppcheck 1.77 issues [#2341] V1
>  
>   [staging/src/amf/amfd/app.cc:285]: (style) The scope of the variable 
> 'i' can
>   be reduced. [staging/src/amf/amfd/apptype.cc:137]: (style) Condition 
> 'rc!=0'
>   is always false [staging/src/amf/amfd/apptype.cc:69]: (style) The scope 
> of
>   the variable 'sg_type' can be reduced. 
> [staging/src/amf/amfd/chkop.cc:1297]
>   -> [staging/src/amf/amfd/chkop.cc:1302]: (style) Variable 'uba' is
>   reassigned a value before the old one has been used.
>   [staging/src/amf/amfd/ckpt_dec.cc:374] ->
>   [staging/src/amf/amfd/ckpt_dec.cc:382]: (style) Variable 'status' is
>   reassigned a value before the old one has been used.
>   [staging/src/amf/amfd/ckpt_dec.cc:573] ->
>   [staging/src/amf/amfd/ckpt_dec.cc:577]: (style) Variable 'status' is
>   reassigned a value before the old one has been used.
>   [staging/src/amf/amfd/ckpt_dec.cc:1109]: (performance) Prefer prefix 
> ++/--
>   operators for non-primitive types. 
> [staging/src/amf/amfd/ckpt_edu.cc:51] ->
>   [staging/src/amf/amfd/ckpt_edu.cc:56]: (style) Variable 'rc' is 
> reassigned a
>   value before the old one has been used.
>   [staging/src/amf/amfd/ckpt_enc.cc:2281] ->
>   [staging/src/amf/amfd/ckpt_enc.cc:2288]: (style) Variable 'status' is
>   reassigned a value before the old one has been used.
>   [staging/src/amf/amfd/ckpt_enc.cc:2314] ->
>   [staging/src/amf/amfd/ckpt_enc.cc:2322]: (style) Variable 'status' is
>   reassigned a value before the old one has been used.
>   [staging/src/amf/amfd/ckpt_enc.cc:1951]: (performance) Prefer prefix 
> ++/--
>   operators for non-primitive types. 
> [staging/src/amf/amfd/ckpt_enc.cc:1982]:
>   (performance) Prefer prefix ++/-- operators for non-primitive types.
>   [staging/src/amf/amfd/ckpt_enc.cc:2015]: (performance) Prefer prefix 
> ++/--
>   operators for non-primitive types. 
> [staging/src/amf/amfd/ckpt_enc.cc:2044]:
>   (performance) Prefer prefix ++/-- operators for non-primitive types.
>   [staging/src/amf/amfd/ckpt_enc.cc:2076]: (performance) Prefer prefix 
> ++/--
>   operators for non-primitive types. 
> [staging/src/amf/amfd/ckpt_enc.cc:2111]:
>   (performance) Prefer prefix ++/-- operators for non-primitive types.
>   [staging/src/amf/amfd/ckpt_enc.cc:2151]: (performance) Prefer prefix 
> ++/--
>   operators for non-primitive types. 
> [staging/src/amf/amfd/ckpt_enc.cc:2176]:
>   (performance) Prefer prefix ++/-- operators for non-primitive types.
>   [staging/src/amf/amfd/ckpt_enc.cc:2216]: (performance) Prefer prefix 
> ++/--
>   operators for non-primitive types. 
> [staging/src/amf/amfd/ckpt_enc.cc:2252]:
>   (performance) Prefer prefix ++/-- operators for non-primitive types.
>   [staging/src/amf/amfd/ckpt_enc.cc:2470]: (performance) Prefer prefix 
> ++/--
>   operators for non-primitive types. [staging/src/amf/amfd/clm.cc:344]:
>   (performance) Prefer prefix ++/-- operators for non-primitive types.
>   

Re: [devel] [PATCH 1 of 1] cpd: update missed out node_users_cnt on standby [#2337]

2017-03-09 Thread ramesh betham
Ack.

Thanks,
Ramesh.

On 3/10/2017 11:17 AM, A V Mahesh wrote:
>   src/ckpt/ckptd/cpd_sbevt.c |  1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
>
> Fixed the missed-out/introduced issue  of  ticket #1669 patch node_users_cnt 
> variable
>
> diff --git a/src/ckpt/ckptd/cpd_sbevt.c b/src/ckpt/ckptd/cpd_sbevt.c
> --- a/src/ckpt/ckptd/cpd_sbevt.c
> +++ b/src/ckpt/ckptd/cpd_sbevt.c
> @@ -586,6 +586,7 @@ uint32_t cpd_sb_proc_ckpt_usrinfo(CPD_CB
>   ckpt_node->num_sections = msg->info.usr_info_2.num_sections;
>   ckpt_node->ckpt_on_scxb1 = msg->info.usr_info_2.ckpt_on_scxb1;
>   ckpt_node->ckpt_on_scxb2 = msg->info.usr_info_2.ckpt_on_scxb2;
> + ckpt_node->node_users_cnt = msg->info.usr_info_2.node_users_cnt;
>   
>   /* Free the old node_users */
>   CPD_NODE_USER_INFO *node_user = ckpt_node->node_users;


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] cpd: update missed out node_users_cnt on standby [#2337]

2017-03-09 Thread Vo Minh Hoang
Hi Mahesh,

ACK. Review only.

Sincerely,
Hoang

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com] 
Sent: Friday, March 10, 2017 12:47 PM
To: hoang.m...@dektech.com.au; ramesh.bet...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] cpd: update missed out node_users_cnt on standby
[#2337]

 src/ckpt/ckptd/cpd_sbevt.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Fixed the missed-out/introduced issue  of  ticket #1669 patch node_users_cnt
variable

diff --git a/src/ckpt/ckptd/cpd_sbevt.c b/src/ckpt/ckptd/cpd_sbevt.c
--- a/src/ckpt/ckptd/cpd_sbevt.c
+++ b/src/ckpt/ckptd/cpd_sbevt.c
@@ -586,6 +586,7 @@ uint32_t cpd_sb_proc_ckpt_usrinfo(CPD_CB
ckpt_node->num_sections = msg->info.usr_info_2.num_sections;
ckpt_node->ckpt_on_scxb1 = msg->info.usr_info_2.ckpt_on_scxb1;
ckpt_node->ckpt_on_scxb2 = msg->info.usr_info_2.ckpt_on_scxb2;
+   ckpt_node->node_users_cnt = msg->info.usr_info_2.node_users_cnt;
 
/* Free the old node_users */
CPD_NODE_USER_INFO *node_user = ckpt_node->node_users;


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] Review request log: Update LOG PR document with version 5.2 enhancements [#2200]

2017-03-09 Thread A V Mahesh
Hi Lennart,

Ack with comments :

1) Please do mention that the current implementation of `alternative 
destinations`
 dose not  support multiple destination concurrently, and will be 
entrenched in future .

2) Update the index

_AVM

On 3/6/2017 8:29 PM, Lennart Lund wrote:
>
> Hi
>
> I have done a number of updates because of comments including the ones 
> below. Attached is an updated version of the document
>
> Thanks
>
> Lennart
>
> *From:*Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> *Sent:* den 2 mars 2017 08:41
> *To:* Lennart Lund ; Canh Van Truong 
> ; 'A V Mahesh' 
> ; opensaf-devel@lists.sourceforge.net
> *Subject:* RE: Review request log: Update LOG PR document with version 
> 5.2 enhancements [#2200]
>
> Hi Lennart,
>
> Ack with few comments.
>
> 1) The "Contents" table has not been updated (not have chapter #4 in)
>
> 2) In table 14
>
> VERSION: 1 (as it is currently specified in rfc5424)
>
> -> Consider to change uppercase “rfc”.
>
> 3) Correct the table 14 caption
>
> “NFC 5424 protocol field usage” to “RFC 5424 protocol field usage”
>
> Regards, Vu
>
> > -Original Message-
>
> > From: Lennart Lund [mailto:lennart.l...@ericsson.com]
>
> > Sent: Wednesday, March 1, 2017 6:33 PM
>
> > To: Vu Minh Nguyen ; Canh Van Truong
>
> > ; A V Mahesh (mahesh.va...@oracle.com)
>
> > ; opensaf-devel@lists.sourceforge.net
>
> > Subject: Review request log: Update LOG PR document with version 5.2
>
> > enhancements [#2200]
>
> >
>
> > Update the document because of the following enhancements:
>
> > #2146 log: implement SaLogFilterSetCallback
>
> > #2258 log: add alternative destinations of log records
>
> >
>
> > Document with recorded changes attached. Activate "Show Changes" to see
>
> > them [Edit/Track Changes/Show Changes]
>
> >
>
> > Thanks
>
> > Lennart
>


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for cpd: update missed out node_users_cnt on standby [#2337]

2017-03-09 Thread A V Mahesh
Summary:cpd: update missed out node_users_cnt on standby [#2337] 
Review request for Trac Ticket(s): #2337
Peer Reviewer(s): Hoang , ramesh
Pull request to: <>
Affected branch(es): default 5.2
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

changeset c94257bb379abeed0b989653052f2fc3790490cb
Author: A V Mahesh 
Date:   Fri, 10 Mar 2017 10:39:21 +0530

cpd: update missed out node_users_cnt on standby [#2337]

 Fixed the missed-out/introduced issue of ticket #1669 patch node_users_cnt 
variable


Complete diffstat:
--
 src/ckpt/ckptd/cpd_sbevt.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Testing Commands:
-
switchover with cpsv application

Testing, Expected Results:
--
no core dump

Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] cpd: update missed out node_users_cnt on standby [#2337]

2017-03-09 Thread A V Mahesh
 src/ckpt/ckptd/cpd_sbevt.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Fixed the missed-out/introduced issue  of  ticket #1669 patch node_users_cnt 
variable

diff --git a/src/ckpt/ckptd/cpd_sbevt.c b/src/ckpt/ckptd/cpd_sbevt.c
--- a/src/ckpt/ckptd/cpd_sbevt.c
+++ b/src/ckpt/ckptd/cpd_sbevt.c
@@ -586,6 +586,7 @@ uint32_t cpd_sb_proc_ckpt_usrinfo(CPD_CB
ckpt_node->num_sections = msg->info.usr_info_2.num_sections;
ckpt_node->ckpt_on_scxb1 = msg->info.usr_info_2.ckpt_on_scxb1;
ckpt_node->ckpt_on_scxb2 = msg->info.usr_info_2.ckpt_on_scxb2;
+   ckpt_node->node_users_cnt = msg->info.usr_info_2.node_users_cnt;
 
/* Free the old node_users */
CPD_NODE_USER_INFO *node_user = ckpt_node->node_users;

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for TIPC_ERR_OVERLOAD in syslog [#2350]

2017-03-09 Thread Hans Nordeback
Hi Mahesh,

yes, that is ok for me.

  /Thanks HansN

On 03/10/17 07:23, A V Mahesh wrote:
> Hi Hans N,
>
> On 3/10/2017 11:49 AM, Hans Nordebäck wrote:
>> Hi Mahesh,
>>
>> Yes, I think 'TIPC_RETDATA' can have INFO, and TIPC_ERR_OVERLOAD as 
>> is, i.e. ERROR. /Regards Hans
>
>  can I change and directly push that  Ok ?
>
> -AVM
>
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: den 10 mars 2017 04:52
>> To: Hans Nordebäck 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for 
>> TIPC_ERR_OVERLOAD in syslog [#2350]
>>
>> Hi Hans N,
>>
>>   >>I think we should lower it to IN
>>
>> what do you prefer to have for `TIPC_RETDATA`  , do you mean INFO ?
>>
>> -AVM
>>
>> On 3/9/2017 8:20 PM, Hans Nordebäck wrote:
>>> Hi Mahesh,
>>>
>>> I missed that this patch also changes TIPC_RETDATA from CR to ER, I
>>> think we should lower it to IN as the failed send should be known at 
>>> the call to send. The TIPC_ERR_OVERLOAD is different, packages has 
>>> been dropped at receiver. There are test cases checking for ER in 
>>> the syslog that fails due to this change.
>>> /Regards Hans
>>>
>>> -Original Message-
>>> From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com]
>>> Sent: den 7 mars 2017 07:57
>>> To: mahesh.va...@oracle.com
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for
>>> TIPC_ERR_OVERLOAD in syslog [#2350]
>>>
>>> Ack, code review only/Thanks HansN
>>>
>>> -Original Message-
>>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>>> Sent: den 7 mars 2017 03:39
>>> To: Hans Nordebäck 
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: [PATCH 1 of 1] mds: reduce log level to Err for
>>> TIPC_ERR_OVERLOAD in syslog [#2350]
>>>
>>>src/mds/mds_dt_tipc.c |  4 ++--
>>>1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>>
>>> Note : MDS still maintained as MDS_LOG_CRITICAL
>>>
>>> diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
>>> --- a/src/mds/mds_dt_tipc.c
>>> +++ b/src/mds/mds_dt_tipc.c
>>> @@ -590,7 +590,7 @@ ssize_t recvfrom_connectionless (int sd,
>>>if (anc->cmsg_type == TIPC_ERRINFO) {
>>>anc_data[0] = *((unsigned 
>>> int*)(CMSG_DATA(anc) + 0));
>>>if (anc_data[0] == TIPC_ERR_OVERLOAD) {
>>> -LOG_CR("MDTM: undelivered message condition 
>>> ancillary data: TIPC_ERR_OVERLOAD");
>>> +LOG_ER("MDTM: undelivered message condition 
>>> ancillary data:
>>> +TIPC_ERR_OVERLOAD");
>>>m_MDS_LOG_CRITICAL("MDTM: undelivered 
>>> message condition ancillary data: TIPC_ERR_OVERLOAD");
>>>} else {
>>>/* TIPC_ERRINFO - TIPC error code 
>>> associated with a returned data message or a connection termination 
>>> message */ @@ -600,7 +600,7 @@ ssize_t recvfrom_connectionless (int sd,
>>>/* If we set TIPC_DEST_DROPPABLE off message 
>>> (configure TIPC to return rejected messages to the sender )
>>>   we will hit this when we implement MDS 
>>> retransmit lost messages, can be replaced with flow control logic */
>>>/* TIPC_RETDATA -The contents of a returned 
>>> data message */
>>> -LOG_CR("MDTM: undelivered message condition 
>>> ancillary data: TIPC_RETDATA");
>>> +LOG_ER("MDTM: undelivered message condition 
>>> ancillary data:
>>> +TIPC_RETDATA");
>>>m_MDS_LOG_CRITICAL("MDTM: undelivered message 
>>> condition ancillary data: TIPC_RETDATA");
>>>} else if (anc->cmsg_type == TIPC_DESTNAME) {
>>>if (sz == 0) {
>>>
>>> --
>>>  Announcing the Oxford Dictionaries API! The API offers
>>> world-renowned dictionary content that is easy and intuitive to 
>>> access. Sign up for an account today to start using our lexical data 
>>> to power your apps and projects. Get started today and enter our 
>>> developer competition.
>>> http://sdm.link/oxford
>>> ___
>>> Opensaf-devel mailing list
>>> Opensaf-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
>


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list

Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for TIPC_ERR_OVERLOAD in syslog [#2350]

2017-03-09 Thread A V Mahesh
Hi Hans N,

On 3/10/2017 11:49 AM, Hans Nordebäck wrote:
> Hi Mahesh,
>
> Yes, I think 'TIPC_RETDATA' can have INFO, and TIPC_ERR_OVERLOAD as is, i.e. 
> ERROR. /Regards Hans

  can I change and directly push that  Ok ?

-AVM

>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: den 10 mars 2017 04:52
> To: Hans Nordebäck 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for 
> TIPC_ERR_OVERLOAD in syslog [#2350]
>
> Hi Hans N,
>
>   >>I think we should lower it to IN
>
> what do you prefer to have for `TIPC_RETDATA`  , do you mean INFO ?
>
> -AVM
>
> On 3/9/2017 8:20 PM, Hans Nordebäck wrote:
>> Hi Mahesh,
>>
>> I missed that this patch also changes TIPC_RETDATA from CR to ER, I
>> think we should lower it to IN as the failed send should be known at the 
>> call to send. The TIPC_ERR_OVERLOAD is different, packages has been dropped 
>> at receiver. There are test cases checking for ER in the syslog that fails 
>> due to this change.
>> /Regards Hans
>>
>> -Original Message-
>> From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com]
>> Sent: den 7 mars 2017 07:57
>> To: mahesh.va...@oracle.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for
>> TIPC_ERR_OVERLOAD in syslog [#2350]
>>
>> Ack, code review only/Thanks HansN
>>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: den 7 mars 2017 03:39
>> To: Hans Nordebäck 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 1 of 1] mds: reduce log level to Err for
>> TIPC_ERR_OVERLOAD in syslog [#2350]
>>
>>src/mds/mds_dt_tipc.c |  4 ++--
>>1 files changed, 2 insertions(+), 2 deletions(-)
>>
>>
>> Note : MDS still maintained as MDS_LOG_CRITICAL
>>
>> diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
>> --- a/src/mds/mds_dt_tipc.c
>> +++ b/src/mds/mds_dt_tipc.c
>> @@ -590,7 +590,7 @@ ssize_t recvfrom_connectionless (int sd,
>>  if (anc->cmsg_type == TIPC_ERRINFO) {
>>  anc_data[0] = *((unsigned 
>> int*)(CMSG_DATA(anc) + 0));
>>  if (anc_data[0] == TIPC_ERR_OVERLOAD) {
>> -LOG_CR("MDTM: undelivered 
>> message condition ancillary data: TIPC_ERR_OVERLOAD");
>> +LOG_ER("MDTM: undelivered 
>> message condition ancillary data:
>> +TIPC_ERR_OVERLOAD");
>>  m_MDS_LOG_CRITICAL("MDTM: 
>> undelivered message condition ancillary data: TIPC_ERR_OVERLOAD");
>>  } else {
>>  /* TIPC_ERRINFO - TIPC error 
>> code associated with a returned data message or a connection termination 
>> message */ @@ -600,7 +600,7 @@ ssize_t recvfrom_connectionless (int sd,
>>  /* If we set TIPC_DEST_DROPPABLE off 
>> message (configure TIPC to return rejected messages to the sender )
>> we will hit this when we implement 
>> MDS retransmit lost messages, can be replaced with flow control logic */
>>  /* TIPC_RETDATA -The contents of a 
>> returned data message */
>> -LOG_CR("MDTM: undelivered message 
>> condition ancillary data: TIPC_RETDATA");
>> +LOG_ER("MDTM: undelivered message 
>> condition ancillary data:
>> +TIPC_RETDATA");
>>  m_MDS_LOG_CRITICAL("MDTM: undelivered 
>> message condition ancillary data: TIPC_RETDATA");
>>  } else if (anc->cmsg_type == TIPC_DESTNAME) {
>>  if (sz == 0) {
>>
>> --
>>  Announcing the Oxford Dictionaries API! The API offers
>> world-renowned dictionary content that is easy and intuitive to access. Sign 
>> up for an account today to start using our lexical data to power your apps 
>> and projects. Get started today and enter our developer competition.
>> http://sdm.link/oxford
>> ___
>> Opensaf-devel mailing list
>> Opensaf-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel 

Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for TIPC_ERR_OVERLOAD in syslog [#2350]

2017-03-09 Thread Hans Nordebäck
Hi Mahesh,

Yes, I think 'TIPC_RETDATA' can have INFO, and TIPC_ERR_OVERLOAD as is, i.e. 
ERROR. /Regards Hans

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com] 
Sent: den 10 mars 2017 04:52
To: Hans Nordebäck 
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for 
TIPC_ERR_OVERLOAD in syslog [#2350]

Hi Hans N,

 >>I think we should lower it to IN

what do you prefer to have for `TIPC_RETDATA`  , do you mean INFO ?

-AVM

On 3/9/2017 8:20 PM, Hans Nordebäck wrote:
> Hi Mahesh,
>
> I missed that this patch also changes TIPC_RETDATA from CR to ER, I 
> think we should lower it to IN as the failed send should be known at the call 
> to send. The TIPC_ERR_OVERLOAD is different, packages has been dropped at 
> receiver. There are test cases checking for ER in the syslog that fails due 
> to this change.
> /Regards Hans
>
> -Original Message-
> From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com]
> Sent: den 7 mars 2017 07:57
> To: mahesh.va...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for 
> TIPC_ERR_OVERLOAD in syslog [#2350]
>
> Ack, code review only/Thanks HansN
>
> -Original Message-
> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
> Sent: den 7 mars 2017 03:39
> To: Hans Nordebäck 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] mds: reduce log level to Err for 
> TIPC_ERR_OVERLOAD in syslog [#2350]
>
>   src/mds/mds_dt_tipc.c |  4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
>
> Note : MDS still maintained as MDS_LOG_CRITICAL
>
> diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
> --- a/src/mds/mds_dt_tipc.c
> +++ b/src/mds/mds_dt_tipc.c
> @@ -590,7 +590,7 @@ ssize_t recvfrom_connectionless (int sd,
>   if (anc->cmsg_type == TIPC_ERRINFO) {
>   anc_data[0] = *((unsigned 
> int*)(CMSG_DATA(anc) + 0));
>   if (anc_data[0] == TIPC_ERR_OVERLOAD) {
> - LOG_CR("MDTM: undelivered 
> message condition ancillary data: TIPC_ERR_OVERLOAD");
> + LOG_ER("MDTM: undelivered 
> message condition ancillary data:
> +TIPC_ERR_OVERLOAD");
>   m_MDS_LOG_CRITICAL("MDTM: 
> undelivered message condition ancillary data: TIPC_ERR_OVERLOAD");
>   } else {
>   /* TIPC_ERRINFO - TIPC error 
> code associated with a returned data message or a connection termination 
> message */ @@ -600,7 +600,7 @@ ssize_t recvfrom_connectionless (int sd,
>   /* If we set TIPC_DEST_DROPPABLE off 
> message (configure TIPC to return rejected messages to the sender )
>  we will hit this when we implement 
> MDS retransmit lost messages, can be replaced with flow control logic */
>   /* TIPC_RETDATA -The contents of a 
> returned data message */
> - LOG_CR("MDTM: undelivered message 
> condition ancillary data: TIPC_RETDATA");
> + LOG_ER("MDTM: undelivered message 
> condition ancillary data:
> +TIPC_RETDATA");
>   m_MDS_LOG_CRITICAL("MDTM: undelivered 
> message condition ancillary data: TIPC_RETDATA");
>   } else if (anc->cmsg_type == TIPC_DESTNAME) {
>   if (sz == 0) {
>
> --
>  Announcing the Oxford Dictionaries API! The API offers 
> world-renowned dictionary content that is easy and intuitive to access. Sign 
> up for an account today to start using our lexical data to power your apps 
> and projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 3] Review Request for amf: Fix all Cppcheck 1.77 issues [#2341] V1

2017-03-09 Thread Gary Lee
Hi Mahesh

Some of our legacy tests are failing after applying this series.

I will do some debugging and send back details.

Thanks
Gary

-Original Message-
From: A V Mahesh 
Date: Wednesday, 8 March 2017 at 11:28 pm
To: , gary , 
, 
Cc: 
Subject: [PATCH 0 of 3] Review Request for amf: Fix all Cppcheck 1.77 issues 
[#2341] V1

Summary:amf: Fix all Cppcheck 1.77 issues [#2341] V1 
Review request for Trac Ticket(s): #2341
Peer Reviewer(s): Amf Dev
Pull request to: <>
Affected branch(es): default, 5.2
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

changeset b8e7593cf4eadaa6169fe635ac0df67560ea875a
Author: A V Mahesh 
Date:   Wed, 08 Mar 2017 17:52:21 +0530

amfd: Fix all Cppcheck 1.77 issues [#2341] V1

[staging/src/amf/amfd/app.cc:285]: (style) The scope of the variable 
'i' can
be reduced. [staging/src/amf/amfd/apptype.cc:137]: (style) Condition 
'rc!=0'
is always false [staging/src/amf/amfd/apptype.cc:69]: (style) The scope 
of
the variable 'sg_type' can be reduced. 
[staging/src/amf/amfd/chkop.cc:1297]
-> [staging/src/amf/amfd/chkop.cc:1302]: (style) Variable 'uba' is
reassigned a value before the old one has been used.
[staging/src/amf/amfd/ckpt_dec.cc:374] ->
[staging/src/amf/amfd/ckpt_dec.cc:382]: (style) Variable 'status' is
reassigned a value before the old one has been used.
[staging/src/amf/amfd/ckpt_dec.cc:573] ->
[staging/src/amf/amfd/ckpt_dec.cc:577]: (style) Variable 'status' is
reassigned a value before the old one has been used.
[staging/src/amf/amfd/ckpt_dec.cc:1109]: (performance) Prefer prefix 
++/--
operators for non-primitive types. 
[staging/src/amf/amfd/ckpt_edu.cc:51] ->
[staging/src/amf/amfd/ckpt_edu.cc:56]: (style) Variable 'rc' is 
reassigned a
value before the old one has been used.
[staging/src/amf/amfd/ckpt_enc.cc:2281] ->
[staging/src/amf/amfd/ckpt_enc.cc:2288]: (style) Variable 'status' is
reassigned a value before the old one has been used.
[staging/src/amf/amfd/ckpt_enc.cc:2314] ->
[staging/src/amf/amfd/ckpt_enc.cc:2322]: (style) Variable 'status' is
reassigned a value before the old one has been used.
[staging/src/amf/amfd/ckpt_enc.cc:1951]: (performance) Prefer prefix 
++/--
operators for non-primitive types. 
[staging/src/amf/amfd/ckpt_enc.cc:1982]:
(performance) Prefer prefix ++/-- operators for non-primitive types.
[staging/src/amf/amfd/ckpt_enc.cc:2015]: (performance) Prefer prefix 
++/--
operators for non-primitive types. 
[staging/src/amf/amfd/ckpt_enc.cc:2044]:
(performance) Prefer prefix ++/-- operators for non-primitive types.
[staging/src/amf/amfd/ckpt_enc.cc:2076]: (performance) Prefer prefix 
++/--
operators for non-primitive types. 
[staging/src/amf/amfd/ckpt_enc.cc:2111]:
(performance) Prefer prefix ++/-- operators for non-primitive types.
[staging/src/amf/amfd/ckpt_enc.cc:2151]: (performance) Prefer prefix 
++/--
operators for non-primitive types. 
[staging/src/amf/amfd/ckpt_enc.cc:2176]:
(performance) Prefer prefix ++/-- operators for non-primitive types.
[staging/src/amf/amfd/ckpt_enc.cc:2216]: (performance) Prefer prefix 
++/--
operators for non-primitive types. 
[staging/src/amf/amfd/ckpt_enc.cc:2252]:
(performance) Prefer prefix ++/-- operators for non-primitive types.
[staging/src/amf/amfd/ckpt_enc.cc:2470]: (performance) Prefer prefix 
++/--
operators for non-primitive types. [staging/src/amf/amfd/clm.cc:344]:
(performance) Prefer prefix ++/-- operators for non-primitive types.
[staging/src/amf/amfd/cluster.cc:82]: (performance) Prefer prefix ++/--
operators for non-primitive types. [staging/src/amf/amfd/cluster.cc:95]:
(performance) Prefer prefix ++/-- operators for non-primitive types.
[staging/src/amf/amfd/cluster.cc:116]: (performance) Prefer prefix ++/--
operators for non-primitive types. [staging/src/amf/amfd/comp.cc:1270] 
->
[staging/src/amf/amfd/comp.cc:1285]: (style) Variable 

Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for TIPC_ERR_OVERLOAD in syslog [#2350]

2017-03-09 Thread A V Mahesh
Hi Hans N,

 >>I think we should lower it to IN

what do you prefer to have for `TIPC_RETDATA`  , do you mean INFO ?

-AVM

On 3/9/2017 8:20 PM, Hans Nordebäck wrote:
> Hi Mahesh,
>
> I missed that this patch also changes TIPC_RETDATA from CR to ER, I think we 
> should lower it to IN as the failed send should be known
> at the call to send. The TIPC_ERR_OVERLOAD is different, packages has been 
> dropped at receiver. There are test cases checking for ER in the syslog that 
> fails due to this change.
> /Regards Hans
>
> -Original Message-
> From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com]
> Sent: den 7 mars 2017 07:57
> To: mahesh.va...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for 
> TIPC_ERR_OVERLOAD in syslog [#2350]
>
> Ack, code review only/Thanks HansN
>
> -Original Message-
> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
> Sent: den 7 mars 2017 03:39
> To: Hans Nordebäck 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] mds: reduce log level to Err for TIPC_ERR_OVERLOAD in 
> syslog [#2350]
>
>   src/mds/mds_dt_tipc.c |  4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
>
> Note : MDS still maintained as MDS_LOG_CRITICAL
>
> diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
> --- a/src/mds/mds_dt_tipc.c
> +++ b/src/mds/mds_dt_tipc.c
> @@ -590,7 +590,7 @@ ssize_t recvfrom_connectionless (int sd,
>   if (anc->cmsg_type == TIPC_ERRINFO) {
>   anc_data[0] = *((unsigned 
> int*)(CMSG_DATA(anc) + 0));
>   if (anc_data[0] == TIPC_ERR_OVERLOAD) {
> - LOG_CR("MDTM: undelivered 
> message condition ancillary data: TIPC_ERR_OVERLOAD");
> + LOG_ER("MDTM: undelivered 
> message condition ancillary data:
> +TIPC_ERR_OVERLOAD");
>   m_MDS_LOG_CRITICAL("MDTM: 
> undelivered message condition ancillary data: TIPC_ERR_OVERLOAD");
>   } else {
>   /* TIPC_ERRINFO - TIPC error 
> code associated with a returned data message or a connection termination 
> message */ @@ -600,7 +600,7 @@ ssize_t recvfrom_connectionless (int sd,
>   /* If we set TIPC_DEST_DROPPABLE off 
> message (configure TIPC to return rejected messages to the sender )
>  we will hit this when we implement 
> MDS retransmit lost messages, can be replaced with flow control logic */
>   /* TIPC_RETDATA -The contents of a 
> returned data message */
> - LOG_CR("MDTM: undelivered message 
> condition ancillary data: TIPC_RETDATA");
> + LOG_ER("MDTM: undelivered message 
> condition ancillary data:
> +TIPC_RETDATA");
>   m_MDS_LOG_CRITICAL("MDTM: undelivered 
> message condition ancillary data: TIPC_RETDATA");
>   } else if (anc->cmsg_type == TIPC_DESTNAME) {
>   if (sz == 0) {
>
> --
> Announcing the Oxford Dictionaries API! The API offers world-renowned 
> dictionary content that is easy and intuitive to access. Sign up for an 
> account today to start using our lexical data to power your apps and 
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] amfd: handle TIMEOUT for avd_imm_applier_set [#2338]

2017-03-09 Thread Gary Lee
HI Nagu

Ack (reviewed + legacy tests run).

Minor comment: perhaps it’s easier to take the log message out of 
amfd_switch_stdby_actv() than add a parameter, since it’s only called from 2 
places.

Thanks
Gary

-Original Message-
From: 
Date: Wednesday, 8 March 2017 at 6:49 pm
To: , , 
, gary 
Cc: 
Subject: [PATCH 1 of 1] amfd: handle TIMEOUT for avd_imm_applier_set [#2338]

 src/amf/amfd/role.cc |  22 --
 src/amf/amfd/role.h  |   2 +-
 2 files changed, 17 insertions(+), 7 deletions(-)


diff --git a/src/amf/amfd/role.cc b/src/amf/amfd/role.cc
--- a/src/amf/amfd/role.cc
+++ b/src/amf/amfd/role.cc
@@ -130,7 +130,7 @@ void avd_role_change_evh(AVD_CL_CB *cb, 
(role == SA_AMF_HA_ACTIVE) && (cb->avail_state_avd == 
SA_AMF_HA_STANDBY)) {
if (true == cb->swap_switch ) {
/* swap resulted Switch  standby -> Active */
-   amfd_switch_stdby_actv(cb);
+   amfd_switch_stdby_actv(cb, true);
status = NCSCC_RC_SUCCESS;
goto done;
}
@@ -803,6 +803,12 @@ try_again:
   failed and amf reinitializes imm interface and
   set applier in avd_imm_reinit_bg_thread. Imm may
   return ERR_EXIST or INVALID_PARAM. */
+   TRACE("ERR_EXIST or INVALID_PARAM");
+   } else if (rc == SA_AIS_ERR_TIMEOUT) {
+   /* Let it proceed as there may be a case of Immd not
+  reachable i.e. node might have gone down during
+  switchover. */
+   TRACE("SA_AIS_ERR_TIMEOUT");
} else
osafassert(0);
} else
@@ -1147,6 +1153,7 @@ uint32_t amfd_switch_qsd_stdby(AVD_CL_CB
  *   change from standby to active in liue of SI SWAP Action
  * 
  * Input: cb - AVD control block pointer.
+ * Input: switch_flag - Whether switchover passed or failed.
  *
  * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
  *
@@ -1155,14 +1162,15 @@ uint32_t amfd_switch_qsd_stdby(AVD_CL_CB
  * 
  
**/
 
-uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb)
+uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb, bool switchover_flag)
 {
uint32_t status = NCSCC_RC_SUCCESS;
SaAisErrorT rc;

TRACE_ENTER();
 
-   LOG_NO("Switching StandBy --> Active State");
+   if (switchover_flag)
+   LOG_NO("Switching StandBy --> Active State");
 
/*
 * Check whether Standby is in sync with Active. If yes then
@@ -1282,8 +1290,10 @@ uint32_t amfd_switch_stdby_actv(AVD_CL_C
}
}
 
-   LOG_NO("Controller switch over done");
-   saflog(LOG_NOTICE, amfSvcUsrName, "Controller switch over done at %x", 
cb->node_id_avd);
+   if (switchover_flag) {
+   LOG_NO("Controller switch over done");
+   saflog(LOG_NOTICE, amfSvcUsrName, "Controller switch over done 
at %x", cb->node_id_avd);
+   }
 
TRACE_LEAVE();
return NCSCC_RC_SUCCESS;
@@ -1311,7 +1321,7 @@ uint32_t amfd_switch_qsd_actv (AVD_CL_CB
if (NCSCC_RC_SUCCESS != avd_rde_set_role(SA_AMF_HA_ACTIVE)) {
LOG_ER("rde role change failed from qsd -> actv");
}
-   return amfd_switch_stdby_actv(cb);
+   return amfd_switch_stdby_actv(cb, false);
 }
 
 
diff --git a/src/amf/amfd/role.h b/src/amf/amfd/role.h
--- a/src/amf/amfd/role.h
+++ b/src/amf/amfd/role.h
@@ -31,7 +31,7 @@ extern uint32_t avd_d2d_chg_role_rsp(AVD
 extern uint32_t avd_d2d_chg_role_req(AVD_CL_CB *cb, AVD_ROLE_CHG_CAUSE_T 
cause, SaAmfHAStateT role);
 
 extern uint32_t amfd_switch_qsd_stdby(AVD_CL_CB *cb);
-extern uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb);
+extern uint32_t amfd_switch_stdby_actv(AVD_CL_CB *cb, bool);
 extern uint32_t amfd_switch_qsd_actv(AVD_CL_CB *cb);
 extern uint32_t amfd_switch_actv_qsd(AVD_CL_CB *cb);
 extern uint32_t initialize_for_assignment(cl_cb_tag* cb,




--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net

Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for TIPC_ERR_OVERLOAD in syslog [#2350]

2017-03-09 Thread Hans Nordebäck
Hi Mahesh,

I missed that this patch also changes TIPC_RETDATA from CR to ER, I think we 
should lower it to IN as the failed send should be known
at the call to send. The TIPC_ERR_OVERLOAD is different, packages has been 
dropped at receiver. There are test cases checking for ER in the syslog that 
fails due to this change.
/Regards Hans

-Original Message-
From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com] 
Sent: den 7 mars 2017 07:57
To: mahesh.va...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1 of 1] mds: reduce log level to Err for 
TIPC_ERR_OVERLOAD in syslog [#2350]

Ack, code review only/Thanks HansN

-Original Message-
From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
Sent: den 7 mars 2017 03:39
To: Hans Nordebäck 
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] mds: reduce log level to Err for TIPC_ERR_OVERLOAD in 
syslog [#2350]

 src/mds/mds_dt_tipc.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Note : MDS still maintained as MDS_LOG_CRITICAL

diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
--- a/src/mds/mds_dt_tipc.c
+++ b/src/mds/mds_dt_tipc.c
@@ -590,7 +590,7 @@ ssize_t recvfrom_connectionless (int sd,
if (anc->cmsg_type == TIPC_ERRINFO) {
anc_data[0] = *((unsigned 
int*)(CMSG_DATA(anc) + 0));
if (anc_data[0] == TIPC_ERR_OVERLOAD) {
-   LOG_CR("MDTM: undelivered 
message condition ancillary data: TIPC_ERR_OVERLOAD");
+   LOG_ER("MDTM: undelivered 
message condition ancillary data: 
+TIPC_ERR_OVERLOAD");
m_MDS_LOG_CRITICAL("MDTM: 
undelivered message condition ancillary data: TIPC_ERR_OVERLOAD");
} else {
/* TIPC_ERRINFO - TIPC error 
code associated with a returned data message or a connection termination 
message */ @@ -600,7 +600,7 @@ ssize_t recvfrom_connectionless (int sd,
/* If we set TIPC_DEST_DROPPABLE off 
message (configure TIPC to return rejected messages to the sender )
   we will hit this when we implement 
MDS retransmit lost messages, can be replaced with flow control logic */
/* TIPC_RETDATA -The contents of a 
returned data message */
-   LOG_CR("MDTM: undelivered message 
condition ancillary data: TIPC_RETDATA");
+   LOG_ER("MDTM: undelivered message 
condition ancillary data: 
+TIPC_RETDATA");
m_MDS_LOG_CRITICAL("MDTM: undelivered 
message condition ancillary data: TIPC_RETDATA");
} else if (anc->cmsg_type == TIPC_DESTNAME) {
if (sz == 0) {

--
Announcing the Oxford Dictionaries API! The API offers world-renowned 
dictionary content that is easy and intuitive to access. Sign up for an account 
today to start using our lexical data to power your apps and projects. Get 
started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] log: fix saflogger tool does not handle timeout for write call [#2358]

2017-03-09 Thread Vu Minh Nguyen
 src/log/tools/saf_logger.c |  24 ++--
 1 files changed, 18 insertions(+), 6 deletions(-)


Add retry machanism for all LOG API in saflogger tool
when the APIs return TIME_OUT.

diff --git a/src/log/tools/saf_logger.c b/src/log/tools/saf_logger.c
--- a/src/log/tools/saf_logger.c
+++ b/src/log/tools/saf_logger.c
@@ -143,7 +143,9 @@ static SaAisErrorT write_log_record(SaLo
 
 retry:
errorCode = saLogWriteLogAsync(logStreamHandle, invocation, 
SA_LOG_RECORD_WRITE_ACK, logRecord);
-   if (errorCode == SA_AIS_ERR_TRY_AGAIN && wait_time < TEN_SECONDS) {
+   if (((errorCode == SA_AIS_ERR_TRY_AGAIN) ||
+(errorCode == SA_AIS_ERR_TIMEOUT))
+   && wait_time < TEN_SECONDS) {
usleep(HUNDRED_MS);
wait_time += HUNDRED_MS;
goto retry;
@@ -426,7 +428,9 @@ int main(int argc, char *argv[])
 
wait_time = 0;
error = saLogInitialize(, , );
-   while (error == SA_AIS_ERR_TRY_AGAIN && wait_time < TEN_SECONDS) {
+   while (((error == SA_AIS_ERR_TRY_AGAIN) ||
+   (error == SA_AIS_ERR_TIMEOUT))
+  && wait_time < TEN_SECONDS) {
usleep(HUNDRED_MS);
wait_time += HUNDRED_MS;
error = saLogInitialize(, , );
@@ -451,7 +455,9 @@ int main(int argc, char *argv[])
wait_time = 0;
error = saLogStreamOpen_2(logHandle, , NULL, 0,
SA_TIME_ONE_SECOND, );
-   while (error == SA_AIS_ERR_TRY_AGAIN && wait_time < TEN_SECONDS) {
+   while (((error == SA_AIS_ERR_TRY_AGAIN) ||
+   (error == SA_AIS_ERR_TIMEOUT))
+  && wait_time < TEN_SECONDS) {
usleep(HUNDRED_MS);
wait_time += HUNDRED_MS;
error = saLogStreamOpen_2(logHandle, , NULL, 0,
@@ -462,7 +468,9 @@ int main(int argc, char *argv[])
wait_time = 0;
error = saLogStreamOpen_2(logHandle, , 
logFileCreateAttributes,
logStreamOpenFlags, SA_TIME_ONE_SECOND, 
);
-   while (error == SA_AIS_ERR_TRY_AGAIN && wait_time < 
TEN_SECONDS) {
+   while (((error == SA_AIS_ERR_TRY_AGAIN) ||
+  (error == SA_AIS_ERR_TIMEOUT))
+  && wait_time < TEN_SECONDS) {
usleep(HUNDRED_MS);
wait_time += HUNDRED_MS;
error = saLogStreamOpen_2(logHandle, , 
logFileCreateAttributes,
@@ -483,7 +491,9 @@ int main(int argc, char *argv[])
 
wait_time = 0;
error = saLogStreamClose(logStreamHandle);
-   while (error == SA_AIS_ERR_TRY_AGAIN && wait_time < TEN_SECONDS) {
+   while (((error == SA_AIS_ERR_TRY_AGAIN) ||
+   (error == SA_AIS_ERR_TIMEOUT))
+  && wait_time < TEN_SECONDS) {
usleep(HUNDRED_MS);
wait_time += HUNDRED_MS;
error = saLogStreamClose(logStreamHandle);
@@ -498,7 +508,9 @@ int main(int argc, char *argv[])
 
wait_time = 0;
error = saLogFinalize(logHandle);
-   while (error == SA_AIS_ERR_TRY_AGAIN && wait_time < TEN_SECONDS) {
+   while (((error == SA_AIS_ERR_TRY_AGAIN) ||
+  (error == SA_AIS_ERR_TIMEOUT))
+   && wait_time < TEN_SECONDS) {
usleep(HUNDRED_MS);
wait_time += HUNDRED_MS;
error = saLogFinalize(logHandle);

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for log: fix saflogger tool does not handle timeout for write call [#2358] V2

2017-03-09 Thread Vu Minh Nguyen
Summary: log: fix saflogger tool does not handle timeout for write call [#2358]
Review request for Trac Ticket(s): #2358
Peer Reviewer(s): Lennart, Canh, Mahesh
Pull request to: <>
Affected branch(es): All
Development branch: Default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   y


Comments (indicate scope for each "y" above):
-
 <>

changeset cc752afd7530da5a267d76d22a37327c5e1cb14e
Author: Vu Minh Nguyen 
Date:   Thu, 09 Mar 2017 19:08:23 +0700

log: fix saflogger tool does not handle timeout for write call [#2358]

Add retry machanism for all LOG API in saflogger tool when the APIs 
return
TIME_OUT.


Complete diffstat:
--
 src/log/tools/saf_logger.c |  24 ++--
 1 files changed, 18 insertions(+), 6 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for log: fix saflogger tool does not handle timeout for write call [#2358]

2017-03-09 Thread Vu Minh Nguyen
Summary: log: fix saflogger tool does not handle timeout for write call [#2358]
Review request for Trac Ticket(s): #2358
Peer Reviewer(s): Lennart, Canh, Mahesh
Pull request to: <>
Affected branch(es): All
Development branch: Default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   y


Comments (indicate scope for each "y" above):
-
 <>

changeset e37afa536fd23de4451664183535171f000286a7
Author: Vu Minh Nguyen 
Date:   Thu, 09 Mar 2017 19:08:23 +0700

log: fix saflogger tool does not handle timeout for write call [#2358]

Add retry machanism when saLogWriteLogAsync() returns TIME_OUT.


Complete diffstat:
--
 src/log/tools/saf_logger.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] log: fix saflogger tool does not handle timeout for write call [#2358]

2017-03-09 Thread Vu Minh Nguyen
 src/log/tools/saf_logger.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Add retry machanism when saLogWriteLogAsync() returns TIME_OUT.

diff --git a/src/log/tools/saf_logger.c b/src/log/tools/saf_logger.c
--- a/src/log/tools/saf_logger.c
+++ b/src/log/tools/saf_logger.c
@@ -143,7 +143,9 @@ static SaAisErrorT write_log_record(SaLo
 
 retry:
errorCode = saLogWriteLogAsync(logStreamHandle, invocation, 
SA_LOG_RECORD_WRITE_ACK, logRecord);
-   if (errorCode == SA_AIS_ERR_TRY_AGAIN && wait_time < TEN_SECONDS) {
+   if (((errorCode == SA_AIS_ERR_TRY_AGAIN) ||
+(errorCode == SA_AIS_ERR_TIMEOUT))
+   && wait_time < TEN_SECONDS) {
usleep(HUNDRED_MS);
wait_time += HUNDRED_MS;
goto retry;

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 2] mds: handle memory leak [#1860]

2017-03-09 Thread Anders Widell
Yes I agree that it is a better semantics to let the API own the 
allocated memory in case the API call was successful, and let the user 
own the allocated memory in case the API call failed. However if we want 
to change the semantics of the API in this way we must go through all 
the places where it is used and modify the code appropriately. From what 
I can see, the users of MDS_DIRECT_SEND currently don't free the 
allocated memory if the MDS call fails.

regards,

Anders Widell

On 03/09/2017 03:39 AM, Vo Minh Hoang wrote:
>
> Dear Anders Widell,
>
> Yes, as you mentioned, this patch offer a change for this behavior.
>
> The reason is as bellowing:
>
>   * Currently, when API succeeds, memory is free in user defined
> callback, not really by MDS itself. Only in some cases API fails,
> MDS frees memory, in some cases MDS does not. So source code is
> not strictly same as PR document.
>   * MDS do not have method to check user init
> memory by using the macro m_MDS_ALLOC_DIRECT_BUFF(x) so this
> behavior is non-defensive coding.
>   * Personally, I think that memory should be init/free in the same
> level except specific reason, I cannot find reason in this case.
>
> Thank you and best regards,
>
> Hoang
>
> *From:*Anders Widell [mailto:anders.wid...@ericsson.com]
> *Sent:* Wednesday, March 8, 2017 9:49 PM
> *To:* Hoang Vo ; mahesh.va...@oracle.com
> *Cc:* opensaf-devel@lists.sourceforge.net
> *Subject:* Re: [PATCH 1 of 2] mds: handle memory leak [#1860]
>
> Hi!
>
> I am trying to understand how these MDS APIs are intended to work. 
> When I read Section 3.2.9.1.7 in OpenSAF_MDSv_PR.odt in the 
> opensaf-internal-docs Mercurial repository, it looks like it is the 
> responsibility of the MDS library to free the provided buffer that was 
> passed in to MDS_DIRECT_SEND, no matter if the MDS API call succeeds 
> or fails. Doesn't this patch change this behaviour in MDS?
>
> regards,
>
> Anders Widell
>
> On 03/06/2017 09:00 AM, Hoang Vo wrote:
>
>   src/base/sysf_mem.c|   3 +++
>
>   src/mds/mds_c_sndrcv.c |  34 +++---
>
>   2 files changed, 18 insertions(+), 19 deletions(-)
>
>   
>
>   
>
> Some error handling does not clean internal memory.
>
> Error handling in dirrect send case clear user memory seem inconsistence,
>
> mds should let creater manage its memory in error cases.
>
>   
>
> action: implement as proposed.
>
>   
>
> diff --git a/src/base/sysf_mem.c b/src/base/sysf_mem.c
>
> --- a/src/base/sysf_mem.c
>
> +++ b/src/base/sysf_mem.c
>
> @@ -1,6 +1,7 @@
>
>   /*  -*- OpenSAF  -*-
>
>*
>
>* (C) Copyright 2008 The OpenSAF Foundation
>
> + * Copyright Ericsson AB 2017 - All Rights Reserved.
>
>*
>
>* This program is distributed in the hope that it will be useful, but
>
>* WITHOUT ANY WARRANTY; without even the implied warranty of 
> MERCHANTABILITY
>
> @@ -428,6 +429,8 @@ USRBUF *sysf_alloc_pkt(unsigned char poo
>
>   if (pool_id >= UB_MAX_POOLS) {
>
>   m_PMGR_UNLK(_ub_pool_mgr.lock);
>
>   m_LEAP_DBG_SINK_VOID;
>
> +m_NCS_MEM_FREE(ub, NCS_MEM_REGION_IO_DATA_HDR, 
> NCS_SERVICE_ID_OS_SVCS, 2);
>
> +ub = (USRBUF *)0;
>
>   return NULL;
>
>   }
>
>   ud = (USRDATA 
> *)gl_ub_pool_mgr.pools[pool_id].mem_alloc(sizeof(USRDATA), pool_id, priority);
>
> diff --git a/src/mds/mds_c_sndrcv.c b/src/mds/mds_c_sndrcv.c
>
> --- a/src/mds/mds_c_sndrcv.c
>
> +++ b/src/mds/mds_c_sndrcv.c
>
> @@ -1,6 +1,7 @@
>
>   /*  -*- OpenSAF  -*-
>
>*
>
>* (C) Copyright 2008 The OpenSAF Foundation
>
> + * Copyright Ericsson AB 2017 - All Rights Reserved.
>
>*
>
>* This program is distributed in the hope that it will be useful, but
>
>* WITHOUT ANY WARRANTY; without even the implied warranty of 
> MERCHANTABILITY
>
> @@ -420,10 +421,6 @@ static uint32_t mds_mcm_direct_send(NCSM
>
>memset(, 0, sizeof(req));
>
>if ((info->info.svc_direct_send.i_priority < MDS_SEND_PRIORITY_LOW) ||
>
>(info->info.svc_direct_send.i_priority > 
> MDS_SEND_PRIORITY_VERY_HIGH)) {
>
> -if (info->info.svc_direct_send.i_direct_buff != NULL) {
>
> -
> m_MDS_FREE_DIRECT_BUFF(info->info.svc_direct_send.i_direct_buff);
>
> -info->info.svc_direct_send.i_direct_buff = NULL;
>
> -}
>
>   m_MDS_LOG_ERR("MDS_SND_RCV: Priority defined is not in 
> range\n");
>
>   return NCSCC_RC_FAILURE;
>
>}
>
> @@ -432,13 +429,11 @@ static uint32_t mds_mcm_direct_send(NCSM
>
>   m_MDS_LOG_ERR("MDS_SND_RCV: Send Message Direct Buff is 
> NULL\n");
>
>   return NCSCC_RC_FAILURE;
>
>} else if 

Re: [devel] [PATCH 1 of 1] log: fix compiling the log unit test failed [#2356]

2017-03-09 Thread A V Mahesh
ACK.

While fixing  cppcheck 1.77  I missed ` src/log/tests/` directory , 
sorry for that.

[/avm/staging-publish/src/log/tests/lgs_dest_test.cc:36]: (performance) 
Function parameter 'attribute_name' should be passed by reference.
[/avm/staging-publish/src/log/tests/lgs_dest_test.cc:37]: (performance) 
Function parameter 'value_list' should be passed by reference.

-AVM


On 3/8/2017 6:44 PM, Vu Minh Nguyen wrote:
>   src/log/tests/lgs_dest_test.cc |  4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
>
> Fix compiling the log unit test failed by correcting
> the dummy function to match with the prototype.
>
> diff --git a/src/log/tests/lgs_dest_test.cc b/src/log/tests/lgs_dest_test.cc
> --- a/src/log/tests/lgs_dest_test.cc
> +++ b/src/log/tests/lgs_dest_test.cc
> @@ -33,8 +33,8 @@ int lgs_cfg_update(const lgs_config_chg_
> return 0;
>   }
>   
> -void lgs_cfgupd_mutival_replace(const std::string attribute_name,
> -const std::vector value_list,
> +void lgs_cfgupd_mutival_replace(const std::string& attribute_name,
> +const std::vector& value_list,
>   lgs_config_chg_t *config_data) {
>   }
>   


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel