unispeech / unimrcp

Open source cross-platform implementation of MRCP protocol
http://www.unimrcp.org
Apache License 2.0
379 stars 167 forks source link

Null MRCPv2 connection occured by accident #259

Closed wujsy closed 4 years ago

wujsy commented 4 years ago

Hi, in my system, used freeswith+unimrcp framework, there are about six thousands calls everyday accessed successfully but several calls failed, in the clinet log file, there are infos like this: "Null MRCPv2 connection 0b9311b2223511ea@speechrecog" this question tortures me and I don't know what's the problem, any ideas? I'll appreciate it. unimrcp version: 1.6.0

achaloyan commented 4 years ago

The statement "Null MRCPv2 connection" is logged when the client application attempts to send a new request to the server, but the TCP connection MRCPv2 messages are carried over is no longer available. This issue might be caused by the server untimely closing or dropping the connection.

wujsy commented 4 years ago

@achaloyan Thank you for your response, I'll check it

lyu0723 commented 4 years ago

@wujsy Hi, I have a same question with you, it was not worked on restarting, could you mind to tell me how to fixed it ? Thinks a lot.

wujsy commented 4 years ago

@lyu0723 sorry, I have not solved yet, and have no idea why server untimely closed the connection

coldnight commented 4 years ago

@achaloyan Could you please check out this https://github.com/signalwire/freeswitch/issues/196, Maybe I submit that to a wrong palce :).

achaloyan commented 4 years ago

On one side, the proposed fixed should not harm. However, I do not think the change addresses the root cause.

The question is how/when connection->sock can be NULL. If you track the client MRCPv2 transport code, you will see that this may happen when the server disconnects. So, it looks like such an event is not properly handled in FS to stop all the activities and release associated resources.

But this issue requires more thorough analysis and investigation, which I have absolutely no time for.

achaloyan commented 4 years ago

See comments in this commit for more info.

lewiszlw commented 2 years ago

Have you solved this problem? @wujsy

coldnight commented 2 years ago

@lewiszlw I can't remember very clearly, as it's kinda long time ago. It could be a sign that UniMRCP's queue is full, and connections had been idled very long time. And finally, I deployed a OpenSIPs that balances multiple UniMRCP instances, that may solved this problem.

lewiszlw commented 2 years ago

Thanks a lot @coldnight . We have plan to integrate opensips as balancer in our systems, but not started. Could you please give your wechat and share you experiences? (You can send to lewiszlw520@gmail.com if you don't mind)

michaelplevy commented 2 years ago

FYI, this thread led me to https://vipul.xyz/2020/06/mrcp-server-load-balancer.html. Perhaps that will be helpful.

lewiszlw commented 2 years ago

@michaelplevy Thanks for sharing.😄 I read this post. It's very helpful. Opensips is a good choice as balancer and I'm working on it now.