Hi,
I've identified a lock contention issue in the rtpengine module's ping timer that can significantly impact call processing under certain conditions.
**Problem:** The `rtpengine_ping_check_timer()` function, triggered periodically by `ping_interval`, holds locks on `rtpp_set_list` for the entire duration of pinging all rtpengine nodes.
Normally, this works find, but when rtpengine instances become unreachable, the lock is held for an long time. For example:
- 2 unreachable rtpengine nodes - 1000ms command timeout - 5 retries per node - locks held for ~10 seconds
**Proposed Solution:** Split the ping operation into three phases: 1. **Phase 1 (with lock):** Create a snapshot of node pointers 2. **Phase 2 (without lock):** Perform actual ping operations on the snapshot 3. **Phase 3 (with lock):** update node state
Since rtpengine nodes are never freed during runtime, the pointers in the snapshot remain valid throughout the ping cycle so lock is not required.
I have implemented and tested this change in my deployment. Should I submit a pull request, or is there a preferred alternative approach?
regards, Rajneesh
On 31/01/2026 05.11, Rajneesh Soni via sr-users wrote:
I have implemented and tested this change in my deployment. Should I submit a pull request, or is there a preferred alternative approach?
PR is ideal yes, please and thank you.
Cheers
Hi,
Thanks Richard !!
I have created a PR - https://github.com/sipwise/kamailio/pull/12
Regards Rajneesh
On Sat, Jan 31, 2026 at 5:17 PM Richard Fuchs via sr-users < sr-users@lists.kamailio.org> wrote:
On 31/01/2026 05.11, Rajneesh Soni via sr-users wrote:
I have implemented and tested this change in my deployment. Should I submit a pull request, or is there a preferred alternative approach?
PR is ideal yes, please and thank you.
Cheers
Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Hello Rajineesh,
just a note – you’ve created a PR in the sipwise github project.
The kamailio github is located here: https://github.com/kamailio/kamailio
So if you want to integrate it into the Kamailio project, it needs to be created here.
Cheers,
Henning
From: Rajneesh Soni via sr-users sr-users@lists.kamailio.org Sent: Sonntag, 1. Februar 2026 05:13 To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Cc: Rajneesh Soni rajneesh@daily.co Subject: [SR-Users] Re: [EXTERNAL] rtpengine: Reduce lock contention during ping timer
Hi,
Thanks Richard !!
I have created a PR - https://github.com/sipwise/kamailio/pull/12
Regards Rajneesh
On Sat, Jan 31, 2026 at 5:17 PM Richard Fuchs via sr-users <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> wrote: On 31/01/2026 05.11, Rajneesh Soni via sr-users wrote:
I have implemented and tested this change in my deployment. Should I submit a pull request, or is there a preferred alternative approach?
PR is ideal yes, please and thank you.
Cheers
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.orgmailto:sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Ohh .... The improvement i am talking about is already implemented - https://github.com/kamailio/kamailio/pull/4305
closed my PR.
On Sun, Feb 1, 2026 at 2:06 PM Henning Westerholt hw@gilawa.com wrote:
Hello Rajineesh,
just a note – you’ve created a PR in the sipwise github project.
The kamailio github is located here: https://github.com/kamailio/kamailio
So if you want to integrate it into the Kamailio project, it needs to be created here.
Cheers,
Henning
*From:* Rajneesh Soni via sr-users sr-users@lists.kamailio.org *Sent:* Sonntag, 1. Februar 2026 05:13 *To:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *Cc:* Rajneesh Soni rajneesh@daily.co *Subject:* [SR-Users] Re: [EXTERNAL] rtpengine: Reduce lock contention during ping timer
Hi,
Thanks Richard !!
I have created a PR - https://github.com/sipwise/kamailio/pull/12
Regards
Rajneesh
On Sat, Jan 31, 2026 at 5:17 PM Richard Fuchs via sr-users < sr-users@lists.kamailio.org> wrote:
On 31/01/2026 05.11, Rajneesh Soni via sr-users wrote:
I have implemented and tested this change in my deployment. Should I submit a pull request, or is there a preferred alternative approach?
PR is ideal yes, please and thank you.
Cheers
Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!