HEP sender: every dropped message logs its own error once the send queue is full

Aperta
#2,236 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c
Ambito
backend

Direzione di ricerca

Start with daemon/homer.c at the homer_send() queue limit check cited in the issue, then inspect how the project’s logging limiters are keyed. Reproduce with a TCP HEP collector that accepts but never reads and send NG queries as described. Done means queue overflow logs are bounded across calls while dropped messages remain counted or otherwise understandable.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

rtpengine version the issue has been seen with

mr26.3.1.3 (abc98192d77ebadd57bef9f7387f16be2e53d5b9), built from the tag, userspace only. homer_send() is the same on master.

Used distribution and its version

Debian 13 (container)

Linux kernel version used

6.8.0-117-generic (kernel module not used)

CPU architecture issue was seen on

aarch64

Expected behaviour you didn't see

When the HEP collector stops reading, homer_send() drops new messages once the queue holds SEND_QUEUE_LIMIT (200). Dropping is fine, but the error should be logged at a bounded rate.

Unexpected behaviour you saw

Every dropped message logs its own LOG_ERR line (daemon/homer.c#L229-L234). With a TCP collector that accepts the connection but never reads, 20,000 NG commands (40,000 HEP messages with --homer-enable-ng) produced 28,742 identical error lines in 1.4 s. On a busy relay a slow or stuck collector fills the log at that rate.

Steps to reproduce the problem

  1. Listen on TCP 127.0.0.1:9060, accept the connection and never read from it (a small SO_RCVBUF makes it quicker).

  2. Start rtpengine:

    rtpengine --foreground --log-stderr --table=-1 --interface=127.0.0.1 --listen-ng=127.0.0.1:2223 --homer=127.0.0.1:9060 --homer-protocol=tcp --homer-id=2001 --homer-enable-ng --port-min=30000 --port-max=30100
    
  3. Send 20,000 NG query commands for an unknown call-id over UDP to 127.0.0.1:2223, each waiting for its reply.

  4. Count Send queue length limit lines in the log.

Additional program output to the terminal or logs illustrating the issue

[no-such-]: [core] Send queue length limit (200) reached, dropping Homer message
[core] Send queue length limit (200) reached, dropping Homer message
[no-such-]: [core] Send queue length limit (200) reached, dropping Homer message
... 28,742 lines in 1.4 s

Anything else?

The per-message line dates from the 2016 queue limit (d45f928c98), when HEP carried only RTCP stats; NG tracing (7905811c53, 2024) adds two HEP messages per NG command, which is what makes the rate this high.

LOG_FLAG_LIMIT would be the usual way to bound this, but its limiter keys on the log prefix, which includes the call-id, so with many concurrent calls it would still log once per call every 15 s. A single limit for the sender (for example one line per 15 s, perhaps with the number of messages dropped since the last line) would keep the log readable.

Lingua principale
Perl
Stelle
992
Fork
459
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sipwise/rtpengine

Tutte le issue di sipwise/rtpengine

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.