Menu

#1396 log: issue with priority of messages adding to mailbox in the server

5.1.FC
fixed
nobody
None
enhancement
log
-
minor
2016-08-08
2015-06-29
No

If there are several initialize and finalize done in a row in the same process, there is possibility getting SA_AIS_ERR_BAD_HANDLE.

[Test sequence]

  1. saLogInitialize()
  2. saLogFinalize()
  3. saLogInitialize()
  4. saLogFinalize()
    --> get error SA_AIS_ERR_BAD_HANDLE

Here is the problem:

The finalize request will delete the requested client and the agent will wait for the answer (ack). If the last client initialized by this process is finalized the agent will free the resources used by the agent which means that the mds also is finalized which results in an agent down event on the server side.
The agent down message to the event handler is placed in the mailbox queue with the lowest priority.
In this test sequence the next thing that happens is that the agent is started again and a new initiate request is sent. When this request is received on the server the initialize message to the event handler is placed in the queue with the highest priority.

What happen in this case is that the event handler has not yet fetched the agent down message when the initiate message is queued which means that the order of handling the messages will be initialize (highest priority) and then agent down (lowest priority).

  • The initialize will create a client
  • The agent down will remove all clients for the agent process including the just initialized
  • The agent sends a finalize and gets BAD_HANDLE as a reply in the ack from the server since the client is already deleted.

Related

Tickets: #1396

Discussion

  • Anders Bjornerstedt

    • Type: defect --> enhancement
     
  • do truong giang

    do truong giang - 2015-07-22
    • status: unassigned --> assigned
    • assigned_to: do truong giang
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2015-07-23
    • Type: enhancement --> defect
    • Milestone: 5.0 --> 4.5.2
     
  • elunlen

    elunlen - 2015-09-17
    • status: assigned --> accepted
     
  • elunlen

    elunlen - 2015-09-17
    • Type: defect --> enhancement
    • Milestone: 4.5.2 --> 5.0
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2015-11-30
    • status: accepted --> assigned
    • assigned_to: do truong giang --> Vu Minh Nguyen
     
  • Mathi Naickan

    Mathi Naickan - 2015-11-30

    Just FYI, note that there was a similair issue fixed in event service long back.

    Changeset
    summary: edsv: saEvtInitialize has same priority as saEvtFinalize (#2000)

    mnaickan@ubuntu:~/staging$ hg diff -c 2683 | more
    diff --git a/osaf/libs/agents/saf/eda/eda_mds.c b/osaf/libs/agents/saf/eda/eda_mds.c
    --- a/osaf/libs/agents/saf/eda/eda_mds.c
    +++ b/osaf/libs/agents/saf/eda/eda_mds.c
    @@ -1608,7 +1608,8 @@ uint32_t eda_mds_msg_sync_send(EDA_CB *c

    /* Fill the send structure */
    mds_info.info.svc_send.i_msg = (NCSCONTEXT)i_msg;
    
    • if (i_msg->info.api_info.type == EDSV_EDA_RETENTION_TIME_CLR)
    • if ((i_msg->info.api_info.type == EDSV_EDA_RETENTION_TIME_CLR) ||
    • (i_msg->info.api_info.type == EDSV_EDA_INITIALIZE))
      mds_info.info.svc_send.i_priority = MDS_SEND_PRIORITY_MEDIUM;
      else
      mds_info.info.svc_send.i_priority = MDS_SEND_PRIORITY_HIGH;

    Mathi.

    ----- winhvu@users.sf.net wrote:

    • status : accepted --> assigned
    • assigned_to : do truong giang --> Vu Minh Nguyen

    [tickets:#1396] log: issue with priority of messages adding to mailbox
    in the server

    Status: assigned
    Milestone: 5.0.FC
    Created: Mon Jun 29, 2015 09:14 AM UTC by Vu Minh Nguyen
    Last Updated: Sun Nov 01, 2015 09:36 PM UTC
    Owner: Vu Minh Nguyen

    If there are several initialize and finalize done in a row in the same
    process, there is possibility getting SA_AIS_ERR_BAD_HANDLE.

    [Test sequence]
    1. saLogInitialize()
    2. saLogFinalize()
    3. saLogInitialize()
    4. saLogFinalize()
    --> get error SA_AIS_ERR_BAD_HANDLE Here is the problem:

    The finalize request will delete the requested client and the agent
    will wait for the answer (ack). If the last client initialized by this
    process is finalized the agent will free the resources used by the
    agent which means that the mds also is finalized which results in an
    agent down event on the server side.
    The agent down message to the event handler is placed in the mailbox
    queue with the lowest priority.
    In this test sequence the next thing that happens is that the agent is
    started again and a new initiate request is sent. When this request is
    received on the server the initialize message to the event handler is
    placed in the queue with the highest priority.

    What happen in this case is that the event handler has not yet fetched
    the agent down message when the initiate message is queued which means
    that the order of handling the messages will be initialize (highest
    priority) and then agent down (lowest priority).
    - The initialize will create a client
    - The agent down will remove all clients for the agent process
    including the just initialized
    - The agent sends a finalize and gets BAD_HANDLE as a reply in the ack
    from the server since the client is already deleted.

    Sent from sourceforge.net because
    opensaf-tickets@lists.sourceforge.net is subscribed to
    https://sourceforge.net/p/opensaf/tickets/

    To unsubscribe from further messages, a project admin can change
    settings at https://sourceforge.net/p/opensaf/admin/tickets/options.
    Or, if this is a mailing list, you can unsubscribe from the mailing
    list.


    Go from Idea to Many App Stores Faster with Intel(R) XDK
    Give your users amazing mobile app experiences with Intel(R) XDK.
    Use one codebase in this all-in-one HTML5 development environment.
    Design, debug & build mobile apps & 2D/3D high-impact games for
    multiple OSs.
    http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140


    Opensaf-tickets mailing list
    Opensaf-tickets@lists.sourceforge.net
    https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

     

    Related

    Tickets: #1396

  • Vu Minh Nguyen

    Vu Minh Nguyen - 2016-05-06
    • status: assigned --> accepted
    • assigned_to: Vu Minh Nguyen --> Canh Truong
     
  • Canh Truong

    Canh Truong - 2016-06-13
    • status: accepted --> review
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2016-08-08
    • status: review --> fixed
    • assigned_to: Canh Truong --> nobody
    • Milestone: 5.0.FC --> 5.1.FC
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2016-08-08

    changeset: 7843:a474d9b4ad86
    tag: tip
    user: Canh Van Truong canh.v.truong@dektech.com.au
    date: Mon Aug 08 16:39:05 2016 +0700
    summary: log: fix issue with priority of messages adding to mailbox in the server [#1396]

     

    Related

    Tickets: #1396

  • Canh Truong

    Canh Truong - 2016-08-08
    • Milestone: 5.1.FC --> 5.0.FC
     
  • Canh Truong

    Canh Truong - 2016-08-08
    • Milestone: 5.0.FC --> 5.1.FC
     

Log in to post a comment.

MongoDB Logo MongoDB