### Description
After carrying out some load tests using the `Websocket` module, I noticed that sometimes the `websocket:closed` event is not triggered.
This problem seems to be particularly noticeable when the load is high and simultaneous. Example: 1000 records simultaneously.
In the tests carried out, I realized that the number of times the event is not triggered is small, in the order of [1-10]/1000.
I check that when I do a `ws.dump` I don't have any active connections, and I confirm that they are all effectively cleaned (`netstat -ano | grep 8061`).
However, the event is not triggered for some connections.
I can see this in the logs, and also when i display the content of an hash table, i'm dropping key inside `websocket:closed` event.
### Troubleshooting
The troubleshooting was simplistic, i.e. I ran the same test n times, and validated that the event was triggered for all connections, the number of `ws` connections listed by `Kamailio`, and the open connections.
#### Reproduction
To reproduce, we can use any mechanism that emulates the use of the `Websocket` module.
For example, I used the `sipexer` tool to create a `wss` connection with `Kamailio`, forcing simultaneous registrations.
Example command: `sipexer -cb -mt register -ex 60 -au <user> -ap <pass> -fuser example -fd mydomain -wso https://10.0.0.12:10000 -ruri sip:kamailio -su wss://kamailio:8061`
Kamailio TLS listener:
`listen=tls:10.0.0.12:8061 advertise PUBLIC_IP`
Websocket module:
```
loadmodule "websocket.so"
tcp_accept_no_cl=yes
```
```
event_route[websocket:closed] {
xlog("L_NOTICE", "WebSocket connection closed $proto:$si:$sp\n");
<I also delete where a htable key>
}
```
#### Debugging Data
```
[root@ ~]$ prcmd ws.dump
{
connections: {
}
info: {
wscounter: 0
truncated: no
}
}
[root@ ~]$ netstat -ano | grep 8061
tcp 0 0 10.0.0.12:8061 0.0.0.0:* LISTEN off (0.00/0/0)
[root ~]$ prcmd htable.dump wsauth | grep "name" | wc -l
3
[root ~]$ cat /var/log/kamailio.log | grep "WebSocket connection closed" | wc -l
997
[root ~]$ cat /var/log/proxy-registrar/proxy-registrar.log | grep "ERR" | grep "WAR" | wc -l
0
```
#### Log Messages
Nothing relevant.
#### SIP Traffic
Nothing relevant here, the SIP Flow is OK.
### Additional Information
```
version: kamailio 5.6.4 (x86_64/linux) a004cf-dirty
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a004cf -dirty
compiled on 23:17:27 Jun 7 2024 with gcc 4.8.5
```
* **Operating System**:
```
CentOS Linux release 7.9.2009 (Core)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3950
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3950(a)github.com>
- All `secfilter` functions are now accessible in KEMI. For example, you can use KSR.secf_check_ip() directly by importing the KSR module in Python.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
* Exporting all secfilter functions to KEMI.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3940
-- Commit Summary --
* secfilter is fully KEMIized
-- File Changes --
M src/modules/secfilter/secfilter.c (99)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3940.patchhttps://github.com/kamailio/kamailio/pull/3940.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3940
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3940(a)github.com>
- Added `cdp_has_app` function:
- Accepts a single parameter: - `application`: The Application ID.
- Added `cdp_has_app2` function:
- Accepts two parameters: - `vendorid`: The Vendor ID associated with the application. - `application`: The Application ID.
- Added cdp_check_peer function:
- Accepts one parameter: - `fqdn`: the Fully qualified domain name of the peer, that should be checked. The parameter may contain pseudovariables.
NOTE: All parameters are passed as standard strings.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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 -->
- [x] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
* Exporting all cdp functions to KEMI
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3943
-- Commit Summary --
* cdp: export all functions in KEMI module
-- File Changes --
M src/modules/cdp/cdp_mod.c (34)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3943.patchhttps://github.com/kamailio/kamailio/pull/3943.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3943
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3943(a)github.com>