Answered Response to a Get operation when the caller no longer waits

  • Saturday, February 25, 2012 7:56 AM
     
      Has Code

    Hi,
    how should I handle following situation:
    - one service (let say ServiceA) requests the get operation on another service (ServiceB). In serviceA:

    serviceB.Get getState = new serviceB.Get();
    getState.TimeSpan = TimeSpan.FromSeconds(1.0);
    _serviceBPort.Post(getState);
    yield return Arbiter.Choice(serviceB.ResponsePort,
    delegate(serviceB.ServiceBState state) { //some action },
    delegate(Fault failure) 
    { LogError("Get serviceB state failed" + failure.Reason);}
    );

    - serviceB is busy processing request and doesn't respond in one second:

    public virtual IEnumerator<ITask> GetHandler(Get getState)
    {
    TimeConsumingFunction();
    getState.ResponsePort.Post(_state);
    yield break;
    }

    - timeout occurs in serviceA and serviceA continues,
    - serviceB finnaly is ready to send a message but no one waits for it and I've got a warning first:
    "DsspForwarder: Received unsolicited response(http://schemas.microsoft.com/xw/2004/10/dssp.html:GetResponse) from :"
    and then error:
    "### DsspForwarder: OutboundException. Exception: System.TimeoutException: Upłynął limit czasu operacji.. || Action: http://schemas.microsoft.com/xw/2004/10/dssp.html:GetResponse."

    I would like to handle this error in serviceB (preferably) and continue. How and where should I catch this?

    Best regards
    Piotr

All Replies