[asterisk-bugs] [JIRA] (ASTERISK-28197) stasis: ast_endpoint struct holds the channel_ids of channels past destruction in certain cases

Mohit Dhiman (JIRA) noreply at issues.asterisk.org
Mon Dec 24 13:53:47 CST 2018


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

Mohit Dhiman commented on ASTERISK-28197:
-----------------------------------------

I think i got the problem, so during bridging asterisk create another channel (yanked channel or original channel) to transfer the state from initial channel (clone channel) to this newly created channel and later hangup the initial channel after swapping all the states between them.
Here our initial channel structure was created using function {{ast_channel_alloc_with_endpoint}} which populates the {{endpoint_forward}} field of the channel, this field contains information regarding endpoint topics (which contains the {{endpoint_cache_clear}} callback) but the new channel created during bridging is created using function {{ast_channel_alloc}} which doesn't populates the {{endpoint_forward}} field of the channel and after masquerading when the initial channel hangs up the information in {{endpoint_forward}} field also dies with it.

i tried to swap the value of {{endpoint_forward}} field of the two channels in function {{channel_do_masquerade(dest, source)}} and everything seems to work fine.

i'll test this change on heavy load and hope for the better results.

> stasis: ast_endpoint struct holds the channel_ids of channels past destruction in certain cases
> -----------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-28197
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28197
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Channels, Core/Stasis
>    Affects Versions: 13.21.0
>         Environment: Centos 7
>            Reporter: Mohit Dhiman
>              Labels: bridge-application, endpoints.c, memory-leak
>         Attachments: originate_bridge_channel_count_test.txt
>
>
> For every call i made through asterisk to an endpoint the {{ast_endpoint}} struct adds that channel to its channel_ids {{ao2_container}} and after the channel gets destroyed it should remove it from that channel_ids list but the {{channel_count}} for endpoint is continuously increasing for every call i make to that endpoint.
> i verified this by adding some warning logs to the {{ast_endpoint_snapshot_create}} function of {{main/endpoints.c}}, this log prints the channel_count for that endpoint.
> [Dec 5 17:14:45] WARNING[7397] endpoints.c: channel count: 107069 max channel: -1
> [Dec 5 17:14:45] WARNING[7397] endpoints.c: channel count: 107070 max channel: -1
> [Dec 5 17:14:45] WARNING[7397] endpoints.c: channel count: 107071 max channel: -1
> [Dec 5 17:14:45] WARNING[7397] endpoints.c: channel count: 107072 max channel: -1
> here channel count corresponds to
> {{channel_count = ao2_container_count(endpoint->channel_ids);}}
> also there are no more than 400 channels at any instance.



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



More information about the asterisk-bugs mailing list