listen --udp can't share a port with a running logger (reuseport)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, networking
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 57
- Forks
- 30
- Avg merge
- 3h 14m
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OceanDataTools/openrvdas
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
OceanDataTools/openrvdas#760 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
OceanDataTools/openrvdas#758 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
OceanDataTools/openrvdas#748 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 58/100
OceanDataTools/openrvdas#743 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OceanDataTools/openrvdas#721 ·
Maintainers usually reply within 1 day
All issues in OceanDataTools/openrvdas
Similar issues
-
automated endpoint-dead needs-curation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
almanac-data/climate-almanac#138 ·
Maintainers usually reply within 1 day
-
level/subtask type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wazuh/wazuh-virtual-machines#1091 ·
Maintainers usually reply within 1 day
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPossibly taken @halcyon-past claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/semantic-kernel#14824 · 1 comment ·
Maintainers usually reply within 3 days
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#142 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
LedgerHQ/app-bitcoin-legacy#306 ·