]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] Fix memory pool swell under high load. nua_handle_pool_swell 1279/head
authorAndrey Volk <andywolk@gmail.com>
Wed, 21 Jul 2021 16:56:19 +0000 (19:56 +0300)
committerAndrey Volk <andywolk@gmail.com>
Wed, 21 Jul 2021 18:48:30 +0000 (21:48 +0300)
.drone.yml
src/mod/endpoints/mod_sofia/sofia.c

index d8b61ec59bd892731dd6febc1e492bacfe13a243..620a4ed80273669539b7009fca801421b3fc318e 100644 (file)
@@ -14,8 +14,10 @@ steps:
       image: signalwire/freeswitch-public-base
       pull: always
       commands:
-      - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libspandsp-dev
-      - DEBIAN_FRONTEND=noninteractive apt-get -yq install libsofia-sip-ua-dev libspandsp3-dev
+      - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libsofia-sip-ua0 libspandsp-dev
+      - DEBIAN_FRONTEND=noninteractive apt-get -yq install libspandsp3-dev
+      - git clone https://github.com/freeswitch/sofia-sip.git
+      - cd sofia-sip && ./autogen.sh && ./configure.gnu && make -j`nproc` && make install && cd ..
       - echo "applications/mod_test" >> modules.conf
       - echo 'codecs/mod_openh264' >> modules.conf
       - sed -i '/applications\\/mod_http_cache/s/^#//g' modules.conf
@@ -29,8 +31,9 @@ steps:
       image: signalwire/freeswitch-public-base
       pull: always
       commands:
-      - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libspandsp-dev
-      - DEBIAN_FRONTEND=noninteractive apt-get -yq install libsofia-sip-ua-dev libspandsp3-dev
+      - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libsofia-sip-ua0 libspandsp-dev
+      - DEBIAN_FRONTEND=noninteractive apt-get -yq install libspandsp3-dev
+      - cd sofia-sip && make install && cd ..
       - echo '#!/bin/bash\nmake -j`nproc --all` |& tee ./unit-tests-build-result.txt\nexitstatus=$${PIPESTATUS[0]}\necho $$exitstatus > ./build-status.txt\n' > build.sh
       - chmod +x build.sh
       - ./build.sh
@@ -39,8 +42,9 @@ steps:
       image: signalwire/freeswitch-public-base
       pull: always
       commands:
-      - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libspandsp-dev
-      - DEBIAN_FRONTEND=noninteractive apt-get -yq install libsofia-sip-ua-dev libspandsp3-dev
+      - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq remove libsofia-sip-ua0 libspandsp-dev
+      - DEBIAN_FRONTEND=noninteractive apt-get -yq install libspandsp3-dev
+      - cd sofia-sip && make install && cd ..
       - make install || true
       - cd tests/unit
       - ./run-tests.sh
@@ -145,6 +149,6 @@ trigger:
 
 ---
 kind: signature
-hmac: bc24832140c40a8fde4bb04bd6bcce43029bf1641ed4acc3585fe52049ae24dc
+hmac: a7ae7220f99ca30639e9e3cfc48489de37a2be5acc5c160269f1bdf6dc5c9d8d
 
 ...
index 70ed479ab5e1f6642b157e55ebb59cb1c08dd993..a7c933b4f66e3318a06505b65c8c46c0e8c6e948 100644 (file)
@@ -2666,9 +2666,18 @@ void sofia_event_callback(nua_event_t event,
 
        sofia_queue_message(de);
 
+       return;
+
  end:
        //switch_cond_next();
 
+       /* 
+        * This sofia_event_callback() function is called by nua_application_event()
+        * which strictly requires application to call nua_handle_destroy()
+        * Since we did not queue the message we should call nua_handle_destroy() now so handles don't pool swell.
+        */
+       nua_handle_destroy(nh);
+
        return;
 }