[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
Tue Nov 17 13:23:33 CST 2015


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

Jonathan Rose commented on ASTERISK-25364:
------------------------------------------

Mr. Komatsu, while I haven't been able to fully reproduce your problem, I've spent a good deal of time studying the issue you saw and have a patch that I hope does solve your problem.  Would you be able to test and report if it works?

I've been studying this issue and my effort to reproduce the exact set of problems you experienced under lab conditions didn't get the same results. However, the patch you posted seems correct in that it sets the TCP keep alive socket option on a TCP socket that previously wasn't using keep alive. The patch seems to assume that this is the same socket that was in use for active sessions and removes the keep alive option from another socket though.

I've made a small change to the patch -- it no longer removes the TCP keep alive option from active sessions. Since I wasn't fully able to reproduce the issue, I request that you all review the new patch and make sure it solves your problem. There is an small chance that it was actually the presence of the keep alive option on the active session socket that caused your problem instead of the lack of a keep alive option on the TCP server socket and I want to be certain that the revised patch fixes your issue before I push it into the repository.

> [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_keep_alive_on_service.diff, 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