Summary: immsv: Revert imma_client_node->replyPending to unsigned char [#1341] Review request for Trac Ticket(s): 1341 Peer Reviewer(s): Neel; Zoran Pull request to: Affected branch(es): 4.5; 4.6; default(4.7) Development branch:
-------------------------------- Impacted area Impact y/n -------------------------------- Docs n Build system n RPM/packaging n Configuration files n Startup scripts n SAF services n OpenSAF services n Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): --------------------------------------------- changeset b2ca36ec5d86f5df64bede49617a31cca1d82484 Author: Anders Bjornerstedt <[email protected]> Date: Mon, 27 Apr 2015 09:48:03 +0200 immsv: Revert imma_client_node->replyPending to unsigned char [#1341] The member imma_client_node->replyPending was in OpenSAF4.1 and earlier defined as 'uns8', i.e. a byte. But this member is a counter and not a boolean. The uns8 type was often used as a proxy for a boolean type in OpenSAF 4.1 and earlier. This was before 'bool' was available as a first class type for gcc. At some point in OpenSAF 4.2 the bool C type became available in gcc. There was then a general sweep across all services to change the use of uns8 to bool. The replyPending member was swept along in this change, but code actually still increments and decrements the value, which makes no sense for a boolean type. The intent of the replyPending member is to keep track of outstanding replies on requests from imma library to immnd server using the handle. This so that a restart of the local IMMND will result in the handle being marked as 'exposed' and not resurrected. An IMMND restart will mean that any unreplied requests will have lost their replies. This violates the interface contract from the imm service side towards the client using the handle and so the handle must not be allowed to get resurrected. Instead the handle must be marked as exposed. The client will then get an ERR_BAD_HANDLE from either saImmOxDispatch (failed active resurrect) or from the next syncronous downcall made after IMMND went down (failed reactive resurrect). For syncronous requests, the count will only go from 0 to 1 and back to 0 on reply. This ticket does not affect syncronous requests. For asyncronous requests it is possible for the client to invoke more than one request, before entering poll to receive replies. For asyncronous requests the replyPending member must work as a counter and not a boolean. The effect of being a boolean is that a handle may get resurrected when there is still asyncronous requests unreplied to, i.e. the replies would get silently lost. This changeset restores the type of the repliesPending member to unsigned char. Complete diffstat: ------------------ osaf/libs/agents/saf/imma/imma_cb.h | 2 +- osaf/libs/agents/saf/imma/imma_proc.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) Testing Commands: ----------------- Complicated to test. REquires the setup of asyncronous admin-operation requests such that multiple requests are perfomed before engaging in the wait for replies. Then force a restart of the local IMMND while more than one equest is still being processed or is queued towards the OI. Multiple OIs could also be used. The IMMND should be restarted after one reply has been received. This will reset the boolean variant of repliesPending to false (no replies pending) which is incorrect. The counter variant will decrement the counter but not to zero. A restat of the IMMND at this stage should cause the handle to be resurrected when the current boolean varaint is used. With htis patch the handle should not get resurrected. Instead ERR_BAD_HANDLE would be returned from saImmOmDispatch. Testing, Expected Results: -------------------------- Resurrect will incorrectly succeed without the patch, but correctly fail with the patch. Conditions of Submission: ------------------------- Ack from Neel. Arch Built Started Linux distro ------------------------------------------- mips n 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. ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
