Hi Kamailians!
Benoît and I have discovered multiple issues we think is related to our use of the Dialog module with DMQ replication. We’ve seen enourmous spikes where SHM memory is quickly consumed to the top limit and Kamailio core dump. We see stuff left in databases that should have been deleted and a few other issues. The crashes worries me most. It could be our signalling pattern or something else that leads to a state where we can’t rely on the the “number of active dialogs” stats.
If any other developer recognize this, or has recently dived into the deep inner workings of Dialog I’ll be happy to have a brainstorm. If not, I’m going to have to take a deep breath and try to figure it out… :-)
At this point we can’t replicate it. We’re going to try hard doing that so that we can assure that any fixes applied will actually work.
Regardless if we have some bad routing, nothing should be able to crash a running Kamailio and eat up memory in an uncontrolled way, so there must be a problem in the code somewhere.
I’ll start parsing the logs…
Cheers,
/O
Hi, I think in the first case you should not return -1 but 0. otherwise these two branches are equal
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/commit/ad7df67cfd58713fc0993e2d2365a86…
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/commit/ad7df67cfd58713fc0993e2d2365a86d9d6068e1/127205212(a)github.com>
The client uses the TLS protocol registered and TCP Connection established . There is a problem now, sending message KSR.uac.uac_req_send() from the kamilio server to client failed sometimes,and the error is as follows:
“2023-09-04T17:22:01.515763+08:00 (3429) ERROR: tm [../../core/forward.h:292]: msg_send_buffer(): tcp_send failed
2023-09-04T17:22:01.515763+08:00 (3429) ERROR: tm [uac.c:678]: send_prepared_request_impl(): Attempt to send to precreated request failed ”. meantime, the client sending message to Kamalio server succeded, and the register status and tcp connection is normal.
After 30s, obtained the $uac_req(evcode) from the event_route[uac:reply] is 408.After this error appears, all the messages sent to this client are 408.
"
2023-08-29T03:48:43.738152+08:00 (3349) NOTICE: <script>: ===uac reply received, callid = 0B6ECB534AE24281AED9BBBC56B140A6`yangwang2`1693252093, code is: 408
2023-08-29T03:48:43.738825+08:00 (3349) NOTICE: <script>: ===uac reply received, callid = 0B6ECB534AE24281AED9BBBC56B140A6`yangwang2`1693252093, code is: 408
"
But from other information, the TCP connection is normal. Because from Kamailio to querying this user's Location, it has not changed all day. The client sends messages is also normal. That is, the user's registration and sending messages can receive 200 OK.
We use netstat commands to view the user's TCP connection information on the client and server, and the connection status is also normal.The status of the corresponding port of the TCP connection is ESTABLISHED.
client:
netstat -ano | findstr 49957
"172. 17. 47.125:49957 XXX.96.XXX.XXX:5061 ESTABLISHED 10516"
server:
"tcp 0 0 10.11.xx.xx:5061 xxx.xxx.xxx.xxx:49957 ESTABLISHED 3467/kamailio"
This client is normal after logging in, and the problem that occurs after a period of use (maybe some hours), and once it occurs, it fails until the user creates a new connection and logs back in. Not all users will appear.
Why is this the case? The socket connection is fine, but uac_req_send () get an ERROR?
I found a problem from the log file. Is it caused by duplicate callids pushed to the same user at the same second?
Looking forward to your answer, thank you very much
Script information that may be required
kamailio.cfg : tm mode
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 120000)
modparam("tm", "auto_inv_100", 1)
kamalio.lua uac_req_send()
" --uac_req_send 推送给终端
KSR.pv.sets("$uac_req(hdrs)", hdrs)
KSR.pv.sets("$uac_req(method)", "MESSAGE")
KSR.pv.sets("$uac_req(ruri)", "sip:" .. to .. "@" .. KAM_DOMAIN)
KSR.pv.sets("$uac_req(furi)", "sip:" .. from .. "@" .. KAM_DOMAIN)
KSR.pv.sets("$uac_req(turi)", "sip:" .. to .. "@" .. KAM_DOMAIN)
KSR.pv.seti("$uac_req(evroute)", 1)
KSR.pv.sets("$uac_req(body)", content)
local ouri = (row.received ~= "" and row.received) or row.contact
KSR.pv.sets("$uac_req(ouri)", ouri)
local callid = rows[i].clientid .. "`" .. rows[i].username .. "`" .. os.time()
KSR.pv.sets("$uac_req(callid)", callid)
KSR.uac.uac_req_send()
GH #
#### Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #3210
#### Description
Added 'always_log_missed_content_length' mode for sanity module.
If 'always_log_missed_content_length' is 1 then the SIP message
with no 'Content-Length' header will cause warning message in
the logs. Otherwise warning message is not generated for cases
when SIP message with no 'Content-Length' header is sent over UDP.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3359
-- Commit Summary --
* No warning generated when UDP and no Content-Length header
-- File Changes --
M src/modules/sanity/doc/sanity_admin.xml (21)
M src/modules/sanity/sanity.c (4)
M src/modules/sanity/sanity_mod.c (12)
M src/modules/sanity/sanity_mod.h (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3359.patchhttps://github.com/kamailio/kamailio/pull/3359.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3359
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3359(a)github.com>
Module: kamailio
Branch: master
Commit: 670742de0f2cef5ad9d478780bbeacec6597ae30
URL: https://github.com/kamailio/kamailio/commit/670742de0f2cef5ad9d478780bbeace…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2023-09-12T13:16:26+02:00
modules: readme files regenerated - app_lua ... [skip ci]
---
Modified: src/modules/app_lua/README
---
Diff: https://github.com/kamailio/kamailio/commit/670742de0f2cef5ad9d478780bbeace…
Patch: https://github.com/kamailio/kamailio/commit/670742de0f2cef5ad9d478780bbeace…
---
diff --git a/src/modules/app_lua/README b/src/modules/app_lua/README
index c4697435ee0..f8891270e1a 100644
--- a/src/modules/app_lua/README
+++ b/src/modules/app_lua/README
@@ -149,7 +149,7 @@ Chapter 1. Admin Guide
Set the path to the Lua script to be loaded at startup. Then you can
use lua_run(function, params) to execute a function from the script at
- runtime.
+ runtime. The script can be in Lua-source or bytecode.
Default value is ���null���.