Re: [devel] [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement object, but CCB was aborted due to IMM [#2676]

2017-11-17 Thread Lennart Lund
Hi Vijay

It seems as this is getting a bit messy. These loops are added all over the 
place and (at least) in one case one of the loops did not work since it 
included a function that does more than one thing and at least one thing the 
function does did not fail the first time and can because of that not be done 
again even if some other part failed etc.
It seem as it is mostly IMM handling that is simplified so that possibilities 
of recovery is not used.
I think that if we continue to fix things like this we will soon lose control. 
I suggest that we do the following instead:
We need to handle recovery and “real” fails:

1. Creating CCBs:
Doing this is rather complicated if all rules shall be followed and all 
recovery possibilities shall be used.
In SMF this is done in many places and in most cases only TRY_AGAIN is handled 
(there is also a lot of redundant code), everything else is considered a Fail 
(will fail the campaign).
I am currently working on a “generic” solution  that can be used in all places 
where the IMM model shall be modified using a CCB. I think this is the most 
complicated part.

2. Admin operations:
This is also done in a simplified way in many places and in different ways with 
redundant code. If we fix CCB handling to be able to recover from e.g. 
BAD_HANDLE we will still fail here so also Admin operations should be handled 
in a “generic” way. I think this is simpler to do than CCB handling.

3. There are probably other OM operations as well that needs to be fixed

What is your opinion about this? After CCB handling, what do you think is most 
important?

Regards
Lennart

From: Vijay Roy [mailto:vijay@oracle.com]
Sent: den 17 november 2017 07:13
To: Rafael Odzakow 
Cc: opensaf-devel@lists.sourceforge.net; Lennart Lund 

Subject: RE: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement 
object, but CCB was aborted due to IMM [#2676]


Hi Rafael,



We need the while loop in “SmfCampaignWrapup::executeCampComplete()” as we 
encountered the issue at Wrapup too while testing.



Thanks

Vijay





-Original Message-
From: Rafael Odzakow [mailto:rafael.odza...@ericsson.com]
Sent: Thursday, November 16, 2017 8:54 PM
To: Vijay Roy >
Cc: 
opensaf-devel@lists.sourceforge.net;
 Lennart Lund >
Subject: Re: [PATCH 1/1] smf: SMF created a CCB to create smfRollbackElement 
object, but CCB was aborted due to IMM [#2676]



What about the added while loops in

SmfCampaignWrapup::executeCampComplete() should they be removed now with this 
addition?





On 11/16/2017 10:44 AM, Vijay Roy wrote:

> Handling ERROR_EXIST in smfRollbackElement creation and handling

> TRY_AGAIN in immCCBOperations.

> ---

>   src/smf/smfd/SmfUpgradeAction.cc | 26 +++---

>   1 file changed, 19 insertions(+), 7 deletions(-)

>

> diff --git a/src/smf/smfd/SmfUpgradeAction.cc

> b/src/smf/smfd/SmfUpgradeAction.cc

> index 94c3dfd..af75cd7 100644

> --- a/src/smf/smfd/SmfUpgradeAction.cc

> +++ b/src/smf/smfd/SmfUpgradeAction.cc

> @@ -28,6 +28,7 @@

>   #include "smf/smfd/SmfUtils.h"

>   #include "smfd.h"

>   #include "smf/smfd/SmfTargetTemplate.h"

> +#include "base/time.h"

>

>   /* 

>*   DEFINITIONS

> @@ -460,6 +461,7 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT 
> i_oiHandle,

>const std::string* i_rollbackDn) {

> SaAisErrorT result = SA_AIS_OK;

> SmfRollbackCcb* rollbackCcb = NULL;

> +  base::Timer doImmOpTimer(6);

>

> TRACE_ENTER();

>

> @@ -473,8 +475,8 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT 
> i_oiHandle,

>   immRollbackCcbDn += ",";

>   immRollbackCcbDn += *i_rollbackDn;

>

> -if ((result = smfCreateRollbackElement(immRollbackCcbDn, i_oiHandle)) !=

> -SA_AIS_OK) {

> +result = smfCreateRollbackElement(immRollbackCcbDn, i_oiHandle);

> +if ((result != SA_AIS_OK) && (result != SA_AIS_ERR_EXIST)) {

> LOG_ER(

> "SmfImmCcbAction::execute failed to create rollback element %s, 
> rc=%s",

> immRollbackCcbDn.c_str(), saf_error(result)); @@ -490,11

> +492,21 @@ SaAisErrorT SmfImmCcbAction::execute(SaImmOiHandleT i_oiHandle,

> }

>

> if (m_operations.size() > 0) {

> -SmfImmUtils immUtil;

> -if ((result = immUtil.doImmOperations(m_operations, rollbackCcb)) !=

> -SA_AIS_OK) {

> -  delete rollbackCcb;

> -  rollbackCcb = NULL;

> +

> +doImmOpTimer.set_timeout_time(6);

> +while (doImmOpTimer.is_timeout() == false) {

> +  SmfImmUtils immUtil;

> +  result = immUtil.doImmOperations(m_operations, rollbackCcb);

> +  if (result == SA_AIS_ERR_TRY_AGAIN) {

> + 

[devel] [PATCH 0/1] Review Request for base: Make pylint output format selectable V2 [#2686]

2017-11-17 Thread Hans Nordeback
Summary: base: Make pylint output format selectable V2 [#2686]
Review request for Ticket(s): 2686
Peer Reviewer(s): AndersW, Srinivas, Nguyen
Pull request to: 
Affected branch(es): develop
Development branch: ticket-2686
Base revision: f324f713e986016dd6719cb244e31e59df8fc01d
Personal repository: git://git.code.sf.net/u/hansnordeback/review


Impacted area   Impact y/n

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

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 957601f5b8afb0d1dfc9b76cc58d692b7c1754d3
Author: Hans Nordeback 
Date:   Fri, 17 Nov 2017 12:32:05 +0100

base: Make pylint output format selectable V2 [#2686]

The output format can now be given, e.g.:

make pylint (defaults to text)
make pylint FORMAT=html
make pylint FORMAT=parseable
make pylint FORMAT=json



Complete diffstat:
--
 Makefile.am   | 4 +++-
 python/README | 8 
 2 files changed, 11 insertions(+), 1 deletion(-)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
*** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***


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 ~/.gitconfig file (i.e. user.name, user.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.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] base: Make pylint output format selectable V2 [#2686]

2017-11-17 Thread Hans Nordeback
The output format can now be given, e.g.:

make pylint (defaults to text)
make pylint FORMAT=html
make pylint FORMAT=parseable
make pylint FORMAT=json
---
 Makefile.am   | 4 +++-
 python/README | 8 
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index f6dd784c3..45fc5c207 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,6 +66,8 @@ AM_LDFLAGS = @OSAF_HARDEN_FLAGS@ -Wl,--as-needed -ldl -lrt 
-pthread -rdynamic
 ACLOCAL_AMFLAGS = -I m4
 OSAF_LIB_FLAGS =
 
+FORMAT = "text"
+
 systemdversion = $(systemdmodversion)
 #
 # Define some useful directory prefixes/suffixes
@@ -436,7 +438,7 @@ checkpatch:
 
 pylint:
@srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
-   cd "$$srcdir/python"; find . -name '*.py' | xargs pylint 
--rcfile=pylintrc --output-format=text > pylint.res; \
+   cd "$$srcdir/python"; find . -name '*.py' | xargs pylint 
--rcfile=pylintrc --output-format=$(FORMAT) > pylint.res; \
true
@echo "The pylint result can be found in the file python/pylint.res"
 
diff --git a/python/README b/python/README
index 798da53db..047a77b2c 100644
--- a/python/README
+++ b/python/README
@@ -228,3 +228,11 @@ for attr in unmarshalNullArray(attrDefs):
unmarshalSaImmValue(attr.attrDefaultValue, attr.attrValueType)
 
 saImmOmClassDescriptionMemoryFree_2(omHandle, attrDefs)
+
+
+To run pylint use the following command:
+
+make pylint (defaults to text)
+make pylint FORMAT=html
+make pylint FORMAT=parseable
+make pylint FORMAT=json
\ No newline at end of file
-- 
2.14.2


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] base: Make pylint output format selectable [#2686]

2017-11-17 Thread Hans Nordeback
The output format can now be given, e.g.:

make pylint (defaults to text)
make pylint FORMAT=html
make pylint FORMAT=parseable
make pylint FORMAT=json
---
 Makefile.am   | 2 +-
 python/README | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index f6dd784c3..84238f1f4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -436,7 +436,7 @@ checkpatch:
 
 pylint:
@srcdir=$$(cd $(top_srcdir); pwd; cd - > /dev/null); \
-   cd "$$srcdir/python"; find . -name '*.py' | xargs pylint 
--rcfile=pylintrc --output-format=text > pylint.res; \
+   cd "$$srcdir/python"; find . -name '*.py' | xargs pylint 
--rcfile=pylintrc --output-format=$(FORMAT) > pylint.res; \
true
@echo "The pylint result can be found in the file python/pylint.res"
 
diff --git a/python/README b/python/README
index 798da53db..047a77b2c 100644
--- a/python/README
+++ b/python/README
@@ -228,3 +228,11 @@ for attr in unmarshalNullArray(attrDefs):
unmarshalSaImmValue(attr.attrDefaultValue, attr.attrValueType)
 
 saImmOmClassDescriptionMemoryFree_2(omHandle, attrDefs)
+
+
+To run pylint use the following command:
+
+make pylint (defaults to text)
+make pylint FORMAT=html
+make pylint FORMAT=parseable
+make pylint FORMAT=json
\ No newline at end of file
-- 
2.14.2


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/1] Review Request for base: Make pylint output format selectable [#2686]

2017-11-17 Thread Hans Nordeback
Summary: base: Make pylint output format selectable [#2686]
Review request for Ticket(s): 2686
Peer Reviewer(s): AndersW, Srinivas, Nguyen
Pull request to: 
Affected branch(es): develop
Development branch: ticket-2686
Base revision: f324f713e986016dd6719cb244e31e59df8fc01d
Personal repository: git://git.code.sf.net/u/hansnordeback/review


Impacted area   Impact y/n

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

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision c3abd385a424fd586a011cbcbda22e2fb18aa78b
Author: Hans Nordeback 
Date:   Fri, 17 Nov 2017 09:44:09 +0100

base: Make pylint output format selectable [#2686]

The output format can now be given, e.g.:

make pylint (defaults to text)
make pylint FORMAT=html
make pylint FORMAT=parseable
make pylint FORMAT=json



Complete diffstat:
--
 Makefile.am   | 2 +-
 python/README | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
*** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***


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 ~/.gitconfig file (i.e. user.name, user.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.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel