calejost / unimrcp

Automatically exported from code.google.com/p/unimrcp
Apache License 2.0
0 stars 0 forks source link

Stale MRCP sessions upon MRCP link disconnection #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a session
2. Request a recognizer resource
3. Do some load grammars
4. Restart the Loquendo MRCPv2 Server
  (***session stalls (no more events) from the point of view of the
application***)
5. Do more load grammars
6. Issue recognize request

What version of the product are you using? On what operating system?
Trunk Release 1042. Windows 2003 Server 32 bit.

Please provide any additional information below.

When MRCP connection is lost he event is logged on the trace on
mrcp_client_connection.c/mrcp_client_agent_messsage_receive and no event is
sent to the application, in fact there is a commented out line that looks
like this:

...
    if(status == APR_EOF || length == 0) {
        apt_log(APT_LOG_MARK,APT_PRIO_INFO,"TCP/MRCPv2 Peer Disconnected
%s",connection->id);
        apt_pollset_remove(agent->pollset,&connection->sock_pfd);
        apr_socket_close(connection->sock);
        connection->sock = NULL;

//      agent->vtable->on_disconnect(agent,connection);
        return TRUE;
    }
...

  I suspect this line would deliver this error event back to the
application but somehow it is not yet implemented.
  Currently there is no workaround for this as the other operations on the
session don't give credible return codes so the only way is to rely on
timeout mechanisms which is rather painful to implement and in practise
disastrous as it may take a long time for the application to spot these
conditions (comparing to the situation where we can rely on a specific
event that can be more "instantaneous").
  Thanks for your time. As always, please feel free to ask more details if
you need.

  Regards.

Original issue reported on code.google.com by cpsoa...@gmail.com on 15 Jul 2009 at 4:40

GoogleCodeExporter commented 8 years ago
Hi cpsoares.
Conceptually it's clear that an event from client stack should be raised to
applications for such cases, nobody argues.
In other words everything was and is clear, this routine just needs to be 
implemented.

Original comment by achalo...@gmail.com on 16 Jul 2009 at 6:48

GoogleCodeExporter commented 8 years ago
I've just got a couple of minutes and implemented missing stuff (r1055).
Now your application should get either error response to the request sent to the
server or on_terminate_event() depending when server restarts.
Works as intended to me. Give it a try.

Original comment by achalo...@gmail.com on 17 Jul 2009 at 1:56

GoogleCodeExporter commented 8 years ago
Have you got a chance to try this out?

Original comment by achalo...@gmail.com on 22 Jul 2009 at 10:10

GoogleCodeExporter commented 8 years ago
  Arsen,

  Just finished testing this scenario using your fix and all is ok now.
  Thanks once again for your time.

Original comment by cpsoa...@gmail.com on 22 Jul 2009 at 12:18

GoogleCodeExporter commented 8 years ago

Original comment by achalo...@gmail.com on 25 Aug 2009 at 5:44