bensari / mediaserver

Automatically exported from code.google.com/p/mediaserver
1 stars 0 forks source link

UnreachablePortException in RTPDataChannel #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The media server does not allow mixing of local and RTP connections in cnf 
endpoints. Therefore, RestComm has to use RTP connections for internal 
connections as well as external connections. After a connection has been 
created when a DLCX is sent to MMS the BaseEndpointImpl closes the connection 
but it doesn't remove it from the active connections in the connections pool. 
In conclusion when the RTPDataChannel tasks are run they try to send RTP 
traffic to connections that are no longer active generating ICMP responses and 
Unreachable port exceptions. Attached is a patch that solves this issue.

Original issue reported on code.google.com by quintana...@gmail.com on 21 Jul 2012 at 12:45

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by quintana...@gmail.com on 21 Jul 2012 at 2:46

GoogleCodeExporter commented 8 years ago
Media Server does allows mixing of local and rtp connections in cnf 
endpoints!!!! it does not allows it in local to remote bridge.

When dlcx is send BaseEndpointImpl calls ((BaseConnection)connection).close();
Base Connection in turns calls this.onClosed();

onClosed in RtpConenctionImpl :

protected void onClosed() {
        descriptor2 = null;

        try {
            setMode(ConnectionMode.INACTIVE);
        } catch (ModeNotSupportedException e) {
        }

        if (this.isAudioCapabale) {
                audioChannel.disconnect();
            this.rtpAudioChannel.close();
        }

        if (this.isVideoCapable) {
                videoChannel.disconnect();
            this.rtpVideoChannel.close();
        }

        connections.releaseConnection(this,ConnectionType.RTP);        
        this.connectionFailureListener=null;          
    }

It does disables mode , closes channels and calls connections.releaseConnection
Therefore connection is removed from active connections list.

Port Unreachable is sent for other reason - Because when client sends bye , 
till it reaches mss and mss notifies the mms to delete connection , mms tries 
to send data.
but on client side the port is closed

Rejecting a patch

Original comment by oifa.yul...@gmail.com on 21 Jul 2012 at 1:17

GoogleCodeExporter commented 8 years ago
Yulian when I tried to mix local and rtp connections I had no audio. I still 
have our conversations on GChat where you explicitly acknowledge the problem. 
Furthermore, I followed the execution path for DeleteConnectionCmd and arrived 
at that conclusion which seems to have fixed the problem. I guarantee you 
Amazon is not closing out ports as you have suggested.

Original comment by quintana...@gmail.com on 21 Jul 2012 at 1:33

GoogleCodeExporter commented 8 years ago
Hello
I have posted in my answer the code path , you can verify it by yourself.
The connection is deleted by onClosed of rtp connection impl and local
connection impl , therefore there is no need
to call it from BaseEndpoint Impl.

Original comment by oifa.yul...@gmail.com on 21 Jul 2012 at 1:40

GoogleCodeExporter commented 8 years ago
Again as I stated I followed the DeleteConnectionCmd execution path and I
just don't see where onClosed() is being called and with the pasted changes
the exception stops occurring.

Original comment by quintana...@gmail.com on 21 Jul 2012 at 1:50

GoogleCodeExporter commented 8 years ago
Hi Thomas
First of all we have spoked about local to remote bridge , which by definition 
does not mixes local and rtp connections , and not cnf which does mixes 
connections of all types.

2) I have posted the code path.
You can see by yourself that connections.releaseConnection is called.
There is no need to call this twice , once from OnClosed in RtpConnectionImpl , 
once in BaseEndpointImpl.
It can not fix the problem of mixing! since we are talking about connection 
delete stage and mixing should occure only when connection is alive / active ( 
before connection delete is called ).
Also if the connections would not release in the end of all you where running 
out of free connections and where getting exceptions on crcx telling no free 
connections exists, and this does not happens.

Stop shooting in all directions thomas , i understand your need to solve the 
issues you are having , but its required more time to debug.I am 100% sure that 
logging that you have added gave you invalid direction.

To help you first of all start running , identify the problems you are 
having.Not from logs you have added , but from clients / your response.
Send me a list , we will focus on one by one basis on problems and check them.

Best regards
Yulian Oifa

Original comment by oifa.yul...@gmail.com on 21 Jul 2012 at 1:51

GoogleCodeExporter commented 8 years ago
Hello 
And again as i stated please take a look at the path i have shown
1) ((BaseConnection)connection).close(); is called from BaseEndpointImpl 
closeConnection
2) this.onClosed(); is called from BaseConnection.close()
3) onClosed function from RtpConnectionImpl is handling everything

Path is very simple please follow it.
Thats the final response for this issue

Best regards
Yulian Oifa

Original comment by oifa.yul...@gmail.com on 21 Jul 2012 at 2:02

GoogleCodeExporter commented 8 years ago
To update this issue Yulian had included a patch that stops trying to a send 
data to a socket when this exception is raised which should solve the problem 
of recurring PortUnreachableException.

Original comment by quintana...@gmail.com on 22 Jul 2012 at 8:26

GoogleCodeExporter commented 8 years ago
Guys please link commits to Issue so that it is easier to track which commits 
related to which issue. In this case I believe ra1168a3d74fd is the right 
commit. Also try to break down big commits into multiple ones and have 
corresponding issues to commits

Original comment by jean.deruelle on 22 Jul 2012 at 9:10