Ack (Reviewed only)

Thanks
-Nagu

> -----Original Message-----
> From: Gary Lee [mailto:[email protected]]
> Sent: 16 April 2014 12:53
> To: [email protected]; [email protected]; Nagendra Kumar
> Cc: [email protected]
> Subject: [PATCH 1 of 2] amfd: use job queue for IMM admin response [#817]
> 
>  osaf/services/saf/amf/amfd/imm.cc        |  45
> +++++++++++++++++++++++++++----
>  osaf/services/saf/amf/amfd/include/imm.h |  16 +++++++++++
>  2 files changed, 54 insertions(+), 7 deletions(-)
> 
> 
> Currently, admin operation responses from amfd are not synchronised with
> IMM changes that may be performed as part of the admin operation.
> That is, an admin operation may return before the corresponding
> IMM changes have been performed. IMM changes by amfd are typically placed
> into
> a FIFO queue to be done at a later time.
> 
> This patch puts admin operation responses into the same queue. Therefore
> guaranteeing that when an admin operation returns, the corresponding
> IMM changes have already been done.
> 
> diff --git a/osaf/services/saf/amf/amfd/imm.cc
> b/osaf/services/saf/amf/amfd/imm.cc
> --- a/osaf/services/saf/amf/amfd/imm.cc
> +++ b/osaf/services/saf/amf/amfd/imm.cc
> @@ -228,6 +228,40 @@ ImmObjDelete::~ImmObjDelete()
>  }
> 
>  //
> +AvdJobDequeueResultT ImmAdminResponse::exec(const SaImmOiHandleT
> handle) {
> +     SaAisErrorT rc;
> +     AvdJobDequeueResultT res;
> +
> +     TRACE_ENTER2("Admin resp inv:%llu res:%u", this->invocation_, this-
> >result_);
> +
> +     rc = saImmOiAdminOperationResult(handle, this->invocation_, this-
> >result_);
> +
> +     switch (rc) {
> +     case SA_AIS_OK:
> +             delete Fifo::dequeue();
> +             res = JOB_EXECUTED;
> +             break;
> +     case SA_AIS_ERR_TRY_AGAIN:
> +             TRACE("TRY-AGAIN");
> +             res = JOB_ETRYAGAIN;
> +             break;
> +     case SA_AIS_ERR_BAD_HANDLE:
> +             // there is no need to reattempt reply,
> +             // fall through to default to remove from queue
> +             TRACE("BADHANDLE");
> +             avd_imm_reinit_bg();
> +     default:
> +             delete Fifo::dequeue();
> +             LOG_ER("Admin op failed for invocation: %llu, result %u",
> +                     this->invocation_, this->result_);
> +             res = JOB_ERR;
> +             break;
> +     }
> +
> +     TRACE_LEAVE2("%u", res);
> +     return res;
> +}
> +
>  Job* Fifo::peek()
>  {
>       Job* tmp;
> @@ -1717,15 +1751,12 @@ void avd_saImmOiAdminOperationResult(SaI
> 
> SaInvocationT invocation,
> 
> SaAisErrorT result)
>  {
> -     SaAisErrorT error;
> +     TRACE_ENTER2("inv:%llu, res:%u", invocation, result);
> 
> -     TRACE_ENTER2("inv:%llu, res:%u", invocation, result);
> -     saflog(LOG_NOTICE, amfSvcUsrName, "Admin op done for invocation:
> %llu, result %u",
> -                invocation, result);
> +     ImmAdminResponse *job = new ImmAdminResponse(invocation,
> result);
> +     Fifo::queue(job);
> 
> -     error = immutil_saImmOiAdminOperationResult(immOiHandle,
> invocation, result);
> -     if (error != SA_AIS_OK)
> -             LOG_NO("saImmOiAdminOperationResult for %llu failed %u",
> invocation, error);
> +     TRACE_LEAVE();
>  }
> 
>  /**
> diff --git a/osaf/services/saf/amf/amfd/include/imm.h
> b/osaf/services/saf/amf/amfd/include/imm.h
> --- a/osaf/services/saf/amf/amfd/include/imm.h
> +++ b/osaf/services/saf/amf/amfd/include/imm.h
> @@ -91,6 +91,22 @@ public:
>       ~ImmObjDelete();
>  };
> 
> +class ImmAdminResponse : public Job {
> + public:
> +     ImmAdminResponse(const SaInvocationT invocation,
> +             const SaAisErrorT result) {
> +             this->invocation_ = invocation;
> +             this->result_ = result;
> +     }
> +     AvdJobDequeueResultT exec(SaImmOiHandleT immOiHandle);
> +
> +     ~ImmAdminResponse() {}
> + private:
> +     ImmAdminResponse();
> +     SaInvocationT invocation_;
> +     SaAisErrorT result_;
> +};
> +
>  //
>  class Fifo {
>  public:

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to