Comment 2 for bug 816287

Revision history for this message
Daryl Lublink (dlublink) wrote : Re: Asterisk UDP socket leak

I believe this bug describes asterisk bug #17255 :
https://issues.asterisk.org/view.php?id=17255

It would seem that after some SIP calls, udp sockets are not closed.

If left running too long, you may see the following in asterisk's log ( a few million times a minute ) :

[2011-08-09 09:20:02.775] ERROR[5081] res_timing_timerfd.c: Read error: Bad file descriptor
[2011-08-09 09:20:02.775] DEBUG[5081] res_timing_timerfd.c: Expected to acknowledge 1 ticks but got 0 instead
[2011-08-09 09:20:02.775] ERROR[5081] res_timing_timerfd.c: Read error: Bad file descriptor
[2011-08-09 09:20:02.775] DEBUG[5081] res_timing_timerfd.c: Expected to acknowledge 1 ticks but got 0 instead
[2011-08-09 09:20:02.775] ERROR[5081] res_timing_timerfd.c: Read error: Bad file descriptor
[2011-08-09 09:20:02.775] DEBUG[5081] res_timing_timerfd.c: Expected to acknowledge 1 ticks but got 0 instead
[2011-08-09 09:20:02.775] ERROR[5081] res_timing_timerfd.c: Read error: Bad file descriptor
[2011-08-09 09:20:02.775] DEBUG[5081] res_timing_timerfd.c: Expected to acknowledge 1 ticks but got 0 instead
[2011-08-09 09:20:02.775] ERROR[5081] res_timing_timerfd.c: Read error: Bad file descriptor
[2011-08-09 09:20:02.775] DEBUG[5081] res_timing_timerfd.c: Expected to acknowledge 1 ticks but got 0 instead

The resource exhaustion eventually leads to Asterisk being unable to function as it will either run out of UDP sockets or return errors about open files.

root@ast-1:/var/log/asterisk# lsof | grep asterisk | grep UDP | wc
    121 1089 11004

It has 121 sockets open, but only one call in progress.

Running asterisk : Connected to Asterisk 1.6.2.5-0ubuntu1.4 currently running on pri1 (pid = 5132)