[Home]

Summary:ASTERISK-14689: Asterisk 1.6.2 beta 4 has UDP socket leak when using Sip Timers
Reporter:Private Name (falves11)Labels:
Date Opened:2009-08-21 09:31:21Date Closed:2009-12-15 12:12:04.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:With Sip Timers enabled, the linux count goes through the roof after a a few hours. With only 30 calls the count gets to 5000+, while with Sip Timers disabled (session-timers=refuse) it stays close to 100. This problems takes down the entire Linux OS after a day or so, and also makes Asterisk increasingly slow and CPU consuming. The command 'sip show channels' shows only the right amount of dialogs, so this is not related to an existing bug that deals with a similar, in appearance, problem.

****** ADDITIONAL INFORMATION ******

I don't know how to prove it. If some developer wants to log, I can start the timers and in a few minutes he will see the count of UDP ports in use by linux
lsof -i | grep UDP | wc -l

reach high numbers, and continue growing.
Comments:By: Sean Bright (seanbright) 2009-08-25 09:24:15

Isn't this an exact duplicate of your other issue ASTERISK-14576?



By: Private Name (falves11) 2009-08-25 11:55:20

It is a completely different issue. The 15627 issue was related to the INVITE not being killed when the IP address did not respond, and I got a successful patch for it, if you look at the case. I cannot see why the patch has not been incorporated into the SVN because the 1.4 version for the patch was actually incorporated. Now this new issue shows only when I use SIP Timers, and there are no open SIP dialogs when I type "sip show channels". The leak is caused solely by the use of SIP Timers.

By: Leif Madsen (lmadsen) 2009-08-28 13:35:47

Please attach some sort of debugging information for us to go off of. Thanks!

By: Private Name (falves11) 2009-08-28 13:42:58

As I said, I have no idea how to capture a debug from a live system, particularly when the only evidence of the issue is on Linux, when you type
lsof -i |grep UDP

All I can offer to do is to start the timers in a running box with thousands of calls and you can watch how the UDP socket usage skyrockets.

Please contact me at my personal email falves1@hotmail.com

By: Olle Johansson (oej) 2009-09-10 14:46:11

This is really strange, as we only use one UDP socket and don't open new ones. For TCP, we have multiple sockets. I am also at loss on how to debug this. Can you tell us more about your system?

Are you using only UDP?
which linux/unix platform?
Database connections, using realtime?

We need to get a picture of in which environment this Asterisk livs and sucks UDP sessions in.

By: Olle Johansson (oej) 2009-09-10 14:46:13

This is really strange, as we only use one UDP socket and don't open new ones. For TCP, we have multiple sockets. I am also at loss on how to debug this. Can you tell us more about your system?

Are you using only UDP?
which linux/unix platform?
Database connections, using realtime?

We need to get a picture of in which environment this Asterisk livs and sucks UDP sessions in.

By: Olle Johansson (oej) 2009-09-10 14:48:53

Hang on. This HAS to be related to UDP.

Tell us more! Are you using T.38 or only straight RTP? Audio, video, text?

By: Private Name (falves11) 2009-09-10 14:54:18

My app is just SIP to SIP and SIP to H323. Ni video. I have T.38 disabled. The probkem only shows up with the Timers enabled in all peers.
I can set one of my servers to version 1.6.1 and you may log in and watch.

By: Olle Johansson (oej) 2009-09-10 14:59:00

I think we need to come up with some teories before we can attack this. Does this happen when you only run SIP 2 SIP and NO H.323 too? Just to put H.323 out of the scope.

Since SIP doesn't open UDP ports, session timers must somehow affect the RTP layer. That's my only idea. We will have to ask other developers if they can come up with something clever on this or have time to log in.

By: Private Name (falves11) 2009-09-10 15:25:59

My H323 traffic is minimal. I dispute your idea that SIP does not open UDP ports, since it is all it does. I mean, 100% of SIP goes over UDP, and it is definitely the SIP timers because if I switch them off, the problem stops.

By: Olle Johansson (oej) 2009-09-11 01:20:59

Chan_sip only has *one* open port for SIP over UDP. We listen, we receive messages and keep it open. RTP media opens and closes UDP ports all the time. I don't get how it can be related to session timers, but we will have to find out.

I don't question the relationship you see to SIP timers at all. The problem is that there's no direct relationship between the SIp signalling and open/closing udp ports in the code. We open once when you load the SIP channel and we close it when you shut down. In between, we might reopen ports if you reload the configuration.

By: Private Name (falves11) 2009-09-11 01:28:33

I understand now, only RTP sends media over UDP. SIP is only the signaling, Well, please let me know what steps should we take to get to the bottom of this.
I can upgrade one my busy servers in the morning, Just email me to sales at minixel com when ready to come int.

By: Private Name (falves11) 2009-12-15 11:18:00.000-0600

This case should be closed. The issue is gone.

By: Leif Madsen (lmadsen) 2009-12-15 12:12:04.000-0600

Closed per the reporter. Likely fixed in commit 234095.