Skip to content

rtpproxy: drain timeout notification sockets#3911

Open
sobomax wants to merge 1 commit into
OpenSIPS:masterfrom
sippy:pr_rtpproxy_nsock_drain
Open

rtpproxy: drain timeout notification sockets#3911
sobomax wants to merge 1 commit into
OpenSIPS:masterfrom
sippy:pr_rtpproxy_nsock_drain

Conversation

@sobomax
Copy link
Copy Markdown
Contributor

@sobomax sobomax commented Jun 7, 2026

Summary

RTPProxy may keep the notification connection open while writing a burst of timeout events. The rtpproxy notification callback only performed a single read per reactor wakeup, so already-buffered notifications could be left pending with no further event to wake the process.

Details

This issue has been uncovered while working on an extended version of the voiptests that would also test "no-media notifications". As a result of this bug, only first few notifications are processed. The notification queue after that stalls and never recovers effectively making notifications disabled. The bug has been introduced somewhere along 3.2 timeline, when notification has been refactored to use reactor.

Solution

Set notification sockets nonblocking and drain them until EAGAIN, preserving partial commands between callbacks. Also centralize notification connection cleanup so error, EOF and handler failure paths consistently unregister the fd, free pending data and close the socket.

Once committed, the new version of voiptests will be pushed to make sure this won't get broken again.

RTPProxy may keep the notification connection open while writing a burst of
timeout events.  The rtpproxy notification callback only performed a single
read per reactor wakeup, so already-buffered notifications could be left
pending with no further event to wake the process.

Set notification sockets nonblocking and drain them until EAGAIN, preserving
partial commands between callbacks.  Also centralize notification connection
cleanup so error, EOF and handler failure paths consistently unregister the fd,
free pending data and close the socket.
@sobomax sobomax requested a review from razvancrainea June 7, 2026 02:57
@sobomax
Copy link
Copy Markdown
Contributor Author

sobomax commented Jun 7, 2026

P.S. Tested with both rto.io and external notification socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant