https://github.com/kamailio/kamailio/blob/ae23876b3091db2e62f651e05fa695d29f...
This function appears to be determining, for an unknown reason, that the log message that was sent immediately prior (successfully, I might add) to my logstash server via UDP returned non-zero from the udp_send
I am receiving the message and the subsequent error message just fine, so I am unsure of what the issue could be.
kamailio 5.4.0 (x86_64/linux) 19128f 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: 19128f compiled on 20:14:01 Aug 19 2020 with gcc 4.8.5
CentOS Linux release 7.8.2003 (Core)
x86_64
After further research, it appears that udp_send() returns the result of sendto() which to my understanding returns the number of bytes sent, so it will always be non-zero on a successful send.
It looks like back on Jan 19th the logging message was changed from LG_DBG to udp_send so I'm not sure if that was intentional or maybe an oversight?
Thanks for digging further into it. The change was done to avoid looping back to the same function if the `log_custom` was set as custom logging backend in the core. However, if udp_send() fails for first message, likely to fail for saying the previous execution step failed. So I changed that to printing to stderr directly, just to have a way to try to troubleshoot such cases.
And indeed, send_udp() returns the value of the sendto() and should be positive in case of a successful operation.
The fixes are in master and 5.4 branches -- reference commit: f16d046f6330f897b374d9bb7dab3b2ce8eab3a7 .
Test and if still issues, reopen.
Closed #2452.