[asterisk-bugs] [JIRA] (ASTERISK-25364) [patch]Issue a TCP connection(kernel) and thread of asterisk is not released

Jonathan Rose (JIRA) noreply at issues.asterisk.org
Thu Nov 12 10:23:33 CST 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-25364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=228289#comment-228289 ] 

Jonathan Rose edited comment on ASTERISK-25364 at 11/12/15 10:22 AM:
---------------------------------------------------------------------

I don't think the accept_fd on the sip_tcp_desc and sip_tls_desc structs are using the same file descriptor that was already being used to set the tcptls session file descriptor.

It might be the case that we need to be setting the keep alive option on both the sip_tcp_desc accept_fd and the associated session file descriptor, but I'm not sure. I don't think that this is simply a matter of when we are setting the option as the issue suggests though because the file descriptor numbers are definitely different.

Right now I'm wondering if the errors you are running into are being solved by removing the keep alive option from the session file descriptor or if they are being solved by adding the keep alive option to the session args accept_fd.


was (Author: jrose):
I'm not sure how I feela bout this patch atm. I don't think the accept_fd on the sip_tcp_desc and sip_tls_desc structs are using the same file descriptor that was already being used to set the tcptls session file descriptor.

Now... it might very well be the case that we need to be setting the keep alive option on both the sip_tcp_desc accept_fd and the associated session file descriptor, but I'm not sure. I don't think that this is simply a matter of when we are setting the option as the issue suggests though because the file descriptor numbers are definitely different.

Right now I'm wondering if the errors you are running into are being solved by removing the keep alive option from the session file descriptor or if they are being solved by adding the keep alive option to the session args accept_fd.

> [patch]Issue a TCP connection(kernel) and thread of asterisk is not released
> ----------------------------------------------------------------------------
>
>                 Key: ASTERISK-25364
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25364
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/General
>    Affects Versions: 11.2.0, 11.6.0, 13.5.0
>         Environment: ・centOS 6.5(kernel-2.6.32-431.3.1.el6.x86_64)
> ・certified-asterisk-11.2-cert1
>            Reporter: Hiroaki Komatsu
>            Assignee: Jonathan Rose
>         Attachments: sequence.ppt, sysctl.txt, tcp_connection_and_threads.txt, tcp_keepalive.patch
>
>
> I have done tls communication using the asterisk at the wifi and 3G environment.Among them, the problem of unused tcp connection and threads is not released has occurred.
> Specifically, the resource state on the asterisk environment was not released in the following situations.
>  
> ・Command executed 
>  #netstat -a | grep https
>   →TCP connection is present.(kernel)
>  #asterisk -rx "core show tcp"
>   →TCP connection is not present.(asterisk)
>  #asterisk -rx "core show threads" | grep ast_tcptls_server_root
>   →Thread exists.(asterisk)
>  
> I will attach the results of each command
> (Attached: tcp_connection_and_threads.txt)
> After that, I check the following points first.
>  
> ・Opportunity of event occurrence
>  →TCP/TLS connection sequence has been interrupted(※)
>    halfway for some reason(Attached: sequence.ppt)
>    (※)After the TCP three handshake,
>      client hello message from the terminal has not reached to the asterisk.
>   
> ・The presence or absence of TCP keepalive delivery
>  →TCP keepalive has not been sent.
>    Kernel configuration attached.(Attached: sysctl.txt)
>   
> Then from the above results, we focus on tcp connection 
> and tcp keepalive setting opportunity of asterisk,
> it was done trace source, the actual confirmation.
> From this result, I think the cause of this problem as follows.
> ・asterisk it seems to have done the "addition of TCP connection" and "TCP Enable keepalive" after the connection establishment.
>  
>  Therefore, if the TCP/TLS connection sequence is interrupted in 
>  the middle,asterisk is on to be a wait state in the thread, tcp keepalive also not been enabled.
> The deal, I think should be done to enable the TCP keepalive 
> immediately after tcp/tls socket generation.how is it.(Attached: keepalive.patch)



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list