listen --udp can't share a port with a running logger (reuseport)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend, networking
Direzione di ricerca
Start with listen.py and how it constructs UDPReader; then inspect parse_data_logger_template.yaml, udp_logger_template.yaml, and the existing UDPReader reuse options. Confirm Linux unicast behavior before documenting the flag, since reuseport can divert data from the running logger. Done means the opt-in works in both templates, the listen help warns about unicast, and the documented behavior is verified.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Request
Let listen --udp snoop on a UDP port that a running logger (typically parse_data) already has open, so the docs don't have to tell users to switch parse_data off first.
UDPReader already supports reuseaddr / reuseport, but there are two gaps:
listen --udpcan't turn them on (listen.pybuildsUDPReader(source, port, encoding=encoding)).- A second socket can bind only if the socket already holding the port also set the option, and no shipped template sets it (
parse_data_logger_template.yaml,udp_logger_template.yaml). So alistenflag alone would never be enough.
Caveat: works for broadcast and multicast, not unicast
Whether both readers see the data depends on how the packets are addressed, not on OpenRVDAS.
Tested on macOS (Darwin 25.6), using UDPReader._open_socket() for both sockets: 20 datagrams sent, first socket bound first (standing in for parse_data), second standing in for listen --udp.
| Destination | Options on both sockets | First | Second |
|---|---|---|---|
| unicast to host IP | reuseport |
20 | 0 |
| unicast to host IP, 4 senders | reuseport |
20 | 0 |
| unicast to 127.0.0.1 | reuseport |
20 | 0 |
| subnet broadcast | reuseport |
20 | 20 |
| 255.255.255.255 | reuseport |
20 | 20 |
| any | reuseaddr only |
second bind fails: [Errno 48] Address already in use |
|
| any | reuseaddr + reuseport |
same as reuseport alone |
|
| any | option on only one of the two | second bind fails |
- Broadcast (and multicast): every socket bound to the port gets its own copy. Both readers see everything.
UDPWriterbroadcasts by default when nodestinationis given, and many instruments broadcast, so this is the common case. - Unicast: each datagram goes to only one socket. On macOS that was always the first-bound socket, so the snooper got nothing but did no harm. Linux is untested here. There,
SO_REUSEPORTspreads unicast datagrams across sockets by a hash of the sender's address and port, so a single instrument's data would all go to one socket. If that's the snooper,parse_datasilently stops getting data. That is worse than the current "address already in use" error. (On Linux both processes also need the same effective UID.)
Possible implementation
- Add a
--udp_reuseportflag tolistenthat setsreuseport=Trueon its UDPReaders. The help text should warn that with unicast sources the snooper may take data from the running logger. - Add an opt-in template variable (e.g.
<<udp_reuseport|false>>) toparse_data_logger_template.yamlandudp_logger_template.yaml, so ships with broadcast feeds can turn it on. It should default to false so existing cruise definitions behave the same. - Confirm the Linux unicast behavior before documenting it.
Until then, the docs' advice to switch parse_data off before snooping is the safe option whatever the addressing.
- Lingua principale
- Python
- Stelle
- 57
- Fork
- 30
- Merge medio
- 3h 14m
- PR unite (30g)
- 56
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OceanDataTools/openrvdas
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
OceanDataTools/openrvdas#760 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
OceanDataTools/openrvdas#758 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
OceanDataTools/openrvdas#748 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
OceanDataTools/openrvdas#743 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
OceanDataTools/openrvdas#721 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OceanDataTools/openrvdas
Issue simili
-
automated endpoint-dead needs-curation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
almanac-data/climate-almanac#138 ·
I maintainer di solito rispondono entro 1 giorno
-
level/subtask type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
wazuh/wazuh-virtual-machines#1091 ·
I maintainer di solito rispondono entro 1 giorno
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentForse già presa @halcyon-past l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/semantic-kernel#14824 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stack314/django-neolith#142 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
LedgerHQ/app-bitcoin-legacy#306 ·