[devel] [PATCH 1/1] imm: Restore printout format in immxml tools to maintain backward compatibility [#2728]
- Restore the previous printout format in the immxml tools, which happened to be changed by ticket #2664 for better readability, in order to maintain backward-compatibility for any user scripts/tools that have been depending their check on the former printout. - Some other minor updates regarding formatting. --- src/imm/tools/baseimm.py | 32 +--- src/imm/tools/immxml-merge| 32 src/imm/tools/immxml-validate | 16 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/src/imm/tools/baseimm.py b/src/imm/tools/baseimm.py index fe1c3ce..17e85eb 100644 --- a/src/imm/tools/baseimm.py +++ b/src/imm/tools/baseimm.py @@ -84,7 +84,8 @@ class BaseImmDocument(object): @staticmethod def format_xml_file_with_xmllint(in_file_name, out_file_name): """ Format xml file with xmllint """ -trace("formatXmlFileWithXmlLint() prettify xml file:%s", in_file_name) +trace("format_xml_file_with_xmllint() prettify xml file: %s", + in_file_name) # "prettify" the result file with xmllint # (due to inadequate python/minidom prettify functionality) @@ -123,7 +124,7 @@ class BaseImmDocument(object): doc = open(file_name) str_list = [] imm_contents_tag_found = False -# imm_contents_tag_replaced = False +imm_contents_tag_replaced = False for _line in doc: line = _line if not imm_contents_tag_found: @@ -140,18 +141,19 @@ class BaseImmDocument(object): xml_str = ' '.join(str_list) -# if Options.schemaFilename is not None: -# if imm_contents_tag_replaced: -# print_info_stderr("Cannot validate input file '%s' with " -# "schema file because of missing namespace " -# "specification in element " -# ". \nProceeding with " -# "processing of modified input data!", -# file_name) -# else: -# if self.validate_xml_file(file_name) != 0: -# abort_script("Failed to validate the input file: %s", -# file_name) +if Options.schemaFilename is not None: +if imm_contents_tag_replaced: +print_info_stderr("Cannot validate input file '%s' with " + "schema file because of missing namespace " + "specification in element " + ". \nProceeding with " + "processing of modified input data!", + file_name) +else: +if self.validate_xml_file(file_name) != 0: +abort_script("Failed to validate the input file: %s", + file_name) + return xml.dom.minidom.parseString(xml_str) @staticmethod @@ -188,7 +190,7 @@ def trace(*args): def retrieve_file_names(args): """ Retrieve file names """ -trace("Before glob args:%s", args) +trace("Before glob args: %s", args) # Wildcard expansion for WIN support, however not tested file_list = glob.glob(args[0]) trace("After glob file list: %s length: %d", file_list, len(file_list)) diff --git a/src/imm/tools/immxml-merge b/src/imm/tools/immxml-merge index 7489da3..3a9edda 100755 --- a/src/imm/tools/immxml-merge +++ b/src/imm/tools/immxml-merge @@ -113,7 +113,7 @@ class MergedImmDocument(BaseImmDocument): """ Add classes matching pattern """ class_name = class_element.getAttribute("name") self.classes_parsed = self.classes_parsed + 1 -trace("className: %s nodeType:%d nodeName:%s", class_name, +trace("className:%s nodeType:%d nodeName:%s", class_name, class_element.nodeType, class_element.nodeName) if self.regexpObj is not None: @@ -129,7 +129,7 @@ class MergedImmDocument(BaseImmDocument): Options.grep_class) return -trace("match ok :%s", class_name) +trace("match ok: %s", class_name) # Check if class exists in dictionary map if class_name in self.classDict: @@ -146,7 +146,7 @@ class MergedImmDocument(BaseImmDocument): def add_object(self, object_element, other_nodes): """ Add objects matching pattern """ class_name = object_element.getAttribute("class") -trace("DUMPING Object with className: %s \n %s", class_name, +trace("DUMPING Object with className: %s\n %s", class_name, object_element.toxml()) self.objects_parsed = self.objects_parsed + 1 @@ -160,7 +160,7 @@ class MergedImmDocument(BaseImmDocument): if object_dn_element is None or class_name is None \
[devel] [PATCH 0/1] Review Request for imm: Restore printout format in immxml tools to maintain backward compatibility [#2728]
Summary: imm: Restore printout format in immxml tools to maintain backward compatibility [#2728] Review request for Ticket(s): 2728 Peer Reviewer(s): Zoran Milinkovic, Vu Minh Nguyen Pull request to: Zoran Milinkovic Affected branch(es): develop Development branch: ticket-2728 Base revision: d54303925f86813c5c2fa1103f3c8ed841488145 Personal repository: git://git.code.sf.net/u/nguyenluu/review 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): - revision 17e0c8f44cb70a9763ef8b5b825f20b84d76627b Author: Nguyen LuuDate: Tue, 5 Dec 2017 13:52:39 +0700 imm: Restore printout format in immxml tools to maintain backward compatibility [#2728] - Restore the previous printout format in the immxml tools, which happened to be changed by ticket #2664 for better readability, in order to maintain backward-compatibility for any user scripts/tools that have been depending their check on the former printout. - Some other minor updates regarding formatting. Complete diffstat: -- src/imm/tools/baseimm.py | 32 +--- src/imm/tools/immxml-merge| 32 src/imm/tools/immxml-validate | 16 3 files changed, 41 insertions(+), 39 deletions(-) Testing Commands: - *** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES *** Testing, Expected Results: -- *** PASTE COMMAND OUTPUTS / TEST RESULTS *** Conditions of Submission: - Ack from Zoran. 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 ~/.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] imm: Restore printout format in immxml tools to maintain backward compatibility [#2728]
- Restore the previous printout format in the immxml tools, which happened to be changed by ticket #2664 for better readability, in order to maintain backward-compatibility for any user scripts/tools that have been depending their check on the former printout. - Some other minor updates regarding formatting. --- src/imm/tools/baseimm.py | 32 +--- src/imm/tools/immxml-merge| 32 src/imm/tools/immxml-validate | 16 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/src/imm/tools/baseimm.py b/src/imm/tools/baseimm.py index fe1c3ce..17e85eb 100644 --- a/src/imm/tools/baseimm.py +++ b/src/imm/tools/baseimm.py @@ -84,7 +84,8 @@ class BaseImmDocument(object): @staticmethod def format_xml_file_with_xmllint(in_file_name, out_file_name): """ Format xml file with xmllint """ -trace("formatXmlFileWithXmlLint() prettify xml file:%s", in_file_name) +trace("format_xml_file_with_xmllint() prettify xml file: %s", + in_file_name) # "prettify" the result file with xmllint # (due to inadequate python/minidom prettify functionality) @@ -123,7 +124,7 @@ class BaseImmDocument(object): doc = open(file_name) str_list = [] imm_contents_tag_found = False -# imm_contents_tag_replaced = False +imm_contents_tag_replaced = False for _line in doc: line = _line if not imm_contents_tag_found: @@ -140,18 +141,19 @@ class BaseImmDocument(object): xml_str = ' '.join(str_list) -# if Options.schemaFilename is not None: -# if imm_contents_tag_replaced: -# print_info_stderr("Cannot validate input file '%s' with " -# "schema file because of missing namespace " -# "specification in element " -# ". \nProceeding with " -# "processing of modified input data!", -# file_name) -# else: -# if self.validate_xml_file(file_name) != 0: -# abort_script("Failed to validate the input file: %s", -# file_name) +if Options.schemaFilename is not None: +if imm_contents_tag_replaced: +print_info_stderr("Cannot validate input file '%s' with " + "schema file because of missing namespace " + "specification in element " + ". \nProceeding with " + "processing of modified input data!", + file_name) +else: +if self.validate_xml_file(file_name) != 0: +abort_script("Failed to validate the input file: %s", + file_name) + return xml.dom.minidom.parseString(xml_str) @staticmethod @@ -188,7 +190,7 @@ def trace(*args): def retrieve_file_names(args): """ Retrieve file names """ -trace("Before glob args:%s", args) +trace("Before glob args: %s", args) # Wildcard expansion for WIN support, however not tested file_list = glob.glob(args[0]) trace("After glob file list: %s length: %d", file_list, len(file_list)) diff --git a/src/imm/tools/immxml-merge b/src/imm/tools/immxml-merge index 7489da3..3a9edda 100755 --- a/src/imm/tools/immxml-merge +++ b/src/imm/tools/immxml-merge @@ -113,7 +113,7 @@ class MergedImmDocument(BaseImmDocument): """ Add classes matching pattern """ class_name = class_element.getAttribute("name") self.classes_parsed = self.classes_parsed + 1 -trace("className: %s nodeType:%d nodeName:%s", class_name, +trace("className:%s nodeType:%d nodeName:%s", class_name, class_element.nodeType, class_element.nodeName) if self.regexpObj is not None: @@ -129,7 +129,7 @@ class MergedImmDocument(BaseImmDocument): Options.grep_class) return -trace("match ok :%s", class_name) +trace("match ok: %s", class_name) # Check if class exists in dictionary map if class_name in self.classDict: @@ -146,7 +146,7 @@ class MergedImmDocument(BaseImmDocument): def add_object(self, object_element, other_nodes): """ Add objects matching pattern """ class_name = object_element.getAttribute("class") -trace("DUMPING Object with className: %s \n %s", class_name, +trace("DUMPING Object with className: %s\n %s", class_name, object_element.toxml()) self.objects_parsed = self.objects_parsed + 1 @@ -160,7 +160,7 @@ class MergedImmDocument(BaseImmDocument): if object_dn_element is None or class_name is None \
[devel] [PATCH 0/1] Review Request for Restore printout format in immxml tools to maintain backward compatibility [#2728]
Summary: imm: Restore printout format in immxml tools to maintain backward compatibility [#2728] Review request for Ticket(s): 2728 Peer Reviewer(s): Zoran Milinkovic, Vu Minh Nguyen Pull request to: Zoran Milinkovic Affected branch(es): develop Development branch: ticket-2728 Base revision: d54303925f86813c5c2fa1103f3c8ed841488145 Personal repository: git://git.code.sf.net/u/nguyenluu/review 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): - revision 17e0c8f44cb70a9763ef8b5b825f20b84d76627b Author: Nguyen LuuDate: Tue, 5 Dec 2017 13:52:39 +0700 imm: Restore printout format in immxml tools to maintain backward compatibility [#2728] - Restore the previous printout format in the immxml tools, which happened to be changed by ticket #2664 for better readability, in order to maintain backward-compatibility for any user scripts/tools that have been depending their check on the former printout. - Some other minor updates regarding formatting. Complete diffstat: -- src/imm/tools/baseimm.py | 32 +--- src/imm/tools/immxml-merge| 32 src/imm/tools/immxml-validate | 16 3 files changed, 41 insertions(+), 39 deletions(-) Testing Commands: - *** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES *** Testing, Expected Results: -- *** PASTE COMMAND OUTPUTS / TEST RESULTS *** Conditions of Submission: - Ack from one of the reviewers. 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 ~/.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
[devel] [PATCH 1/1] base: create generic try-again handling decorator for AIS APIs [#2702]
Make generic C++ decorator for handling SA_AIS_ERR_TRY_AGAIN return code of AIS APIs. --- src/ais/Makefile.am| 5 +- src/ais/try_again_decorator.h | 110 + src/base/Makefile.am | 4 +- src/base/tests/try_again_decorator_test.cc | 69 ++ 4 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 src/ais/try_again_decorator.h create mode 100644 src/base/tests/try_again_decorator_test.cc diff --git a/src/ais/Makefile.am b/src/ais/Makefile.am index 77ea2d8..50e4cb6 100644 --- a/src/ais/Makefile.am +++ b/src/ais/Makefile.am @@ -12,7 +12,7 @@ # licensing terms. # -CORE_INCLUDES += -I$(top_srcdir)/src/ais/include +CORE_INCLUDES += -I$(top_srcdir)/src/ais/include -I$(top_srcdir)/src/ais EXTRA_DIST += \ src/ais/lib/libSaAmf.map \ @@ -54,7 +54,8 @@ include_HEADERS += \ src/ais/include/saMsg.h \ src/ais/include/saNtf.h \ src/ais/include/saPlm.h \ - src/ais/include/saSmf.h + src/ais/include/saSmf.h \ + src/ais/try_again_decorator.h pkgconfig_DATA += \ src/ais/lib/opensaf-amf.pc \ diff --git a/src/ais/try_again_decorator.h b/src/ais/try_again_decorator.h new file mode 100644 index 000..19606f0 --- /dev/null +++ b/src/ais/try_again_decorator.h @@ -0,0 +1,110 @@ +/* -*- OpenSAF -*- + * + * 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 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed + * under the GNU Lesser General Public License Version 2.1, February 1999. + * The complete license can be accessed from the following location: + * http://opensource.org/licenses/lgpl-license.php + * See the Copying file included with the OpenSAF distribution for full + * licensing terms. + * + */ + +#ifndef AIS_TRY_AGAIN_DECORATOR_H_ +#define AIS_TRY_AGAIN_DECORATOR_H_ + +#include +#include +#include +#include "base/time.h" + +namespace base { + +//> +// C++ decorator which escapsulates try again handling. +// +// E.g: +// 1) If user wants to call saClmInitialize() which has try again +// handling inside using this decorator, do this: +// +// auto saClmInitialize = base::make_decorator(::saClmInitialize); +// if (saClmInitialize(handle, cbs, version) != SA_AIS_OK) { +//// error handling +// } +// +// 2) If user wants using other retry control policy than default ones, +// then define your own policy like below. The best way is copy the default +// policy, then modify to your own values. +// +// class MyOwnTryAgain { +// public: +// constexpr static bool is_ais_code_accepted(SaAisErrorT code) { +// return (code != SA_AIS_ERR_TRY_AGAIN && code != SA_AIS_ERR_UNAVAILABLE); +// } +// +// public: +// constexpr static uint64_t interval_ms = 10; +// constexpr static uint64_t timeout_ms = 10 * 1000; +// }; +// +// using MyOwnPolicy = base::UseMyPolicy; +// auto saClmInitialize = MyOwnPolicy::make_decorator(::saClmInitialize); +// if (saClmInitialize(handle, cbs, version) != SA_AIS_OK) { +//// error handling +// } +// +//< + +class DefaultRetryPolicy { + public: + // Which error code you want to do the retry. + constexpr static bool is_ais_code_accepted(SaAisErrorT code) { +return (code != SA_AIS_ERR_TRY_AGAIN); + } + + public: + // Sleep time between retries (ms) + constexpr static uint64_t interval_ms = 40; + // Timeout for the retry (ms) + constexpr static uint64_t timeout_ms = 10 * 1000ull; +}; + +template class Decorator; +template +class Decorator{ + public: + explicit Decorator(const std::function & f) : f_{f} {} + T operator()(Args ... args) { +T ais_error = SA_AIS_OK; +base::Timer wtime(Policy::timeout_ms); +while (wtime.is_timeout() == false) { + ais_error = f_(args...); + if (Policy::is_ais_code_accepted(ais_error) == true) break; + base::Sleep({0, Policy::interval_ms * 1000 * 1000ull}); +} +return ais_error; + } + + private: + const std::function f_; +}; + +template +Decorator make_decorator(T (*f)(Args ...)) { + return Decorator (std::function (f)); +} + +template +class UseMyPolicy { + public: + template + static Decorator make_decorator(T (*f)(Args ...)) { +return Decorator (std::function (f)); + } +}; +} // namespace base + +#endif //< AIS_TRY_AGAIN_DECORATOR_H_ diff --git a/src/base/Makefile.am b/src/base/Makefile.am index 956cce6..feafdde 100644 --- a/src/base/Makefile.am +++ b/src/base/Makefile.am @@ -208,7 +208,9 @@ bin_libbase_test_SOURCES = \ src/base/tests/time_compare_test.cc \ src/base/tests/time_convert_test.cc \ src/base/tests/time_subtract_test.cc \ - src/base/tests/unix_socket_test.cc +
Re: [devel] [PATCH 0/1] Review Request for plm: remove child EE info when given standby role [#2710]
signature.asc Description: OpenPGP digital signature -- 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
Re: [devel] [PATCH 0/1] Review Request for smf: Add MDS logging to smfd and smfnd [#2722]
ACK On fre, 2017-12-01 at 16:13 +0100, Lennart Lund wrote: > Summary: smf: Add MDS logging to smfd and smfnd [#2722] > Review request for Ticket(s): 2722 > Peer Reviewer(s): rafael.odza...@ericsson.com > Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE *** > Affected branch(es): develop > Development branch: ticket-2722 > Base revision: d40172a1afb2f95afdb6b6b5cf4804d559ac6c50 > Personal repository: git://git.code.sf.net/u/elunlen/review > > > Impacted area Impact y/n > > Docsn > Build systemn > RPM/packaging n > Configuration files n > Startup scripts n > SAF servicesy > OpenSAF servicesn > Core libraries n > Samples n > Tests n > Other n > > > Comments (indicate scope for each "y" above): > - > *** EXPLAIN/COMMENT THE PATCH SERIES HERE *** > > revision 69653a7b4c6fe9863d3b04d938f20eccc93092aa > Author: Lennart Lund> Date: Fri, 1 Dec 2017 15:58:00 +0100 > > smf: Add MDS logging to smfd and smfnd [#2722] > > Add syslogs to smfd and smfnd to log MDS handling so that > initializing, role > change MDS events etc. All of these logs will be tagged with 'MDS ' > to make > it possible to grep. There will be a number of new logs added to > syslog but > all of these logs will only be written at special occasions like > start up, > service down / up etc. > > > > Complete diffstat: > -- > src/smf/smfd/smfd_amf.cc | 2 ++ > src/smf/smfd/smfd_main.cc | 5 - > src/smf/smfd/smfd_mds.c| 35 +++ > src/smf/smfnd/smfnd_main.c | 1 + > src/smf/smfnd/smfnd_mds.c | 18 ++ > 5 files changed, 48 insertions(+), 13 deletions(-) > > > 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
[devel] [PATCH 0/1] Review Request for log: Added retry logic for RT object creation call fails due to timeout error [#2711]
Summary: log: Added retry logic for RT object creation call fails due to timeout error [#2711] Review request for Ticket(s): 2711 Peer Reviewer(s): *** LIST THE TECH REVIEWER(S) / MAINTAINER(S) HERE *** Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE *** Affected branch(es): develop Development branch: ticket-2711 Base revision: d40172a1afb2f95afdb6b6b5cf4804d559ac6c50 Personal repository: git://git.code.sf.net/u/sri-mangipudy/review 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): - Added retry logic for RT object creation call fails due to timeout error revision 18ade0da54361ca3655daac7542c87eac56dadd7 Author: SrinivasDate: Mon, 4 Dec 2017 14:14:07 +0530 log: Added retry logic for RT object creation call fails due to timeout error [#2711] Complete diffstat: -- src/log/logd/lgs_stream.cc | 44 +++- 1 file changed, 31 insertions(+), 13 deletions(-) Testing Commands: - 1. Keep only SC-1 up. 2. Trigger to suspend immnd(e.i, use SIGSTOP) in the time log client processing saLogStreamOpen_2() to create runtime stream. 3. Continue immnd(e.i, SIGCONT) after catching "saImmOiRtObjectCreate_2 returned 5" in syslog. 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 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 ~/.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] log: Added retry logic for RT object creation call fails due to timeout error [#2711]
--- src/log/logd/lgs_stream.cc | 44 +++- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/src/log/logd/lgs_stream.cc b/src/log/logd/lgs_stream.cc index 65689d6..4f7c3f8 100644 --- a/src/log/logd/lgs_stream.cc +++ b/src/log/logd/lgs_stream.cc @@ -623,19 +623,37 @@ SaAisErrorT lgs_create_rt_appstream(log_stream_t *const stream) { NULL}; { - /** - * Have to have retry for Rt creation. - * Rt update could consider removing retry to avoid blocking - */ - rc = immutil_saImmOiRtObjectCreate_2( - lgs_cb->immOiHandle, const_cast("SaLogStream"), - parentName, attrValues); - free(dndup); - - if (rc != SA_AIS_OK) { -LOG_WA("saImmOiRtObjectCreate_2 returned %u for %s, parent %s", rc, - stream->name.c_str(), parent_name); - } +uint16_t count = 0; +rc = immutil_saImmOiRtObjectCreate_2( +lgs_cb->immOiHandle, const_cast("SaLogStream"), +parentName, attrValues); + +while (((rc == SA_AIS_ERR_TIMEOUT) || (rc == SA_AIS_ERR_BAD_HANDLE)) + && (count < 10)) { +LOG_WA( +"immutil_saImmOiRtObjectCreate_2 returned %u for %s, parent %s", +rc, stream->name.c_str(), parent_name); + +if ( rc == SA_AIS_ERR_BAD_HANDLE ) { +saImmOiFinalize(lgs_cb->immOiHandle); +lgs_cb->immOiHandle = 0; +lgs_cb->immSelectionObject = -1; +/* Initiate IMM reinitializtion */ +lgs_imm_impl_reinit_nonblocking(lgs_cb); +} +count++; +osaf_nanosleep(); +rc = immutil_saImmOiRtObjectCreate_2( +lgs_cb->immOiHandle, const_cast("SaLogStream"), +parentName, attrValues); +} +free(dndup); + +if (rc != SA_AIS_OK) { +LOG_WA( + "saImmOiRtObjectCreate_2 returned %u for %s, parent %s", + rc, stream->name.c_str(), parent_name); +} } } -- 2.7.4 -- 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