Hi,
I'm using tcp_send() to send responses to incoming RPC requests over
TCP. This works fine when responses are small, but tends to fail on
larger responses on somewhat slower links or clients (it fails whenever
the links is not on the loopback interface, even on sub-ms RTT links).
The error message thrown in the logs is:
ERROR: <core> [core/tcp_main.c:618]: _wbufq_add(): (32007 bytes): write
queue full or timeout (18042, total 18042, last write 0 s ago)
I verified the error is due to a full buffer, not a timeout.
I would like the tcp_send() not to fail on a full send buffer. Instead of
failing, it should wait until there is enough space in the buffer again
and send the data. Timeout should still be honoured though.
>From the code this looks like a "feature", but I would classify this as
a bug. The receiver is still receiving, the timeout is not hit but
Kamailio just decides not to send any more data because its (by default
small) buffer is full. If the buffer is full, it should wait until enough
space becomes free again, not fail before the timeout triggers.
The chunks of data that are sent via tcp_send() are always smaller than
tcpconn_wq_max, so they should fit in an empty write buffer.
I'd prefer not to increase tcpconn_wq_max as this will be a never ending
story, the responses will keep growing over time. They're already in the
10's of MB at this time.
Retrying tcp_send() is not an option. After the first failure, the
connection is closed and there is no way for the server (Kamailio) to
open a new connection to the RPC client.
tcp_async is enabled, as that's needed/preferred for the SIP processing.
Is there a way around the (full) write buffer for the caller of
tcp_send()?
--
Alex Hermann
### Description
<!--
After installing the latest update of Kamailio 5.3 and Kamailio 5.2 the pdb module stops working
-->
### Troubleshooting
#### Reproduction
<!--
After creating a mmap file and query it with pdbt you get the correct prefix. A query with Kamailio results in a wrong prefix. It seems like pdb.c returns pointer positions instead of pointer values
-->
#### Debugging Data
### Possible Solutions
<!--
Reverting commit 86ebb4e of #2298
-->
### Additional Information
```
version: kamailio 5.3.4 (x86_64/linux) a35a2f-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_BLACKLIST, 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: a35a2f -dirty
compiled with gcc 4.9.2
```
* **Operating System**:
```
Debian GNU/Linux 8
Linux voip-lab-proxy02 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2345
<!-- 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 -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] 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)
- [ ] 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 #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2350
-- Commit Summary --
* tools/kemi: add script to generate mock api for kemi python testing
-- File Changes --
A misc/tools/kemi/python_mock/README.md (24)
A misc/tools/kemi/python_mock/kemi_mock.py (177)
A misc/tools/kemi/python_mock/test.py (15)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2350.patchhttps://github.com/kamailio/kamailio/pull/2350.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2350
HI.
Could you help me understand this maillist message.
https://lists.kamailio.org/pipermail/sr-dev/2020-April/056608.html
Is that mean - on modern kernel with correct settings Kamailio, sendto() will
fail after ICMP message and then Kamailio is able send INVITE to other
destination?
Sergey
Hi guys,
I'm using Kamailio 5.3.1 in the AWS cloud. For this purpose I'm setting up
a 'nat_public_ipaddr' in the 'advertise' feature:
listen=tls:<%= @ipaddr %>:5061 advertise <%= node['hpbx'][
'nat_public_ipaddr'] %>:5061
listen=tcp:<%= @ipaddr %>:5060 advertise <%= node['hpbx'][
'nat_public_ipaddr'] %>:5060
listen=udp:<%= @ipaddr %>:5060 advertise <%= node['hpbx'][
'nat_public_ipaddr'] %>:5060
When I need relaying an incoming message to one of our internal services
(for example B2BUA, VMAIL etc) I'm setting up an internal address
'@ipaddr' in the Via header instead of 'nat_public_ipaddr' :
set_advertised_address("<%= @ipaddr %>");
set_advertised_port(5060);
All works fine, but Kamailio adds a 'Record-Route' header containing
'nat_public_ipaddr' automatically into such messages. How can I remove this
header or insert my internal address instead before relaying the message?
Is it possible?
Thanks,
Andrey