Port assigning for multiple CPUs
Describe the bug When using multiple CPUs, the port assignments conflict each other.
CI lab ports: Processor 1: port 1234 Processor 2: port 1235 Processor 3: port 1236
TO lab also uses port 1235.
If cFS CPU2 runs, the Ground System cannot use the port 1235.
To Reproduce Steps to reproduce the behavior:
- Start cFS CPU2
- Start Ground System
- See error about cannot bind socket: cFS-GroundSystem/RoutingService.py", line 59, in run self.sock.bind(('', udp_recv_port)) OSError: [Errno 98] Address already in use
Expected behavior There should be separate ports for TO and CI for all CPUs.
Code snips Not applicable.
System observed on:
- Hardware
- OS: Ubuntu 24.10
- Versions: cfe equuleus-rc1+dev223, osal equuleus-rc1+dev93, psp equuleus-rc1+dev55.
Additional context
Reporter Info Szilárd HELF, Remred
There are in my opinion two correct fixes that have their implications.
The first fix is as simple as assigning a port that is sure to not be ever occupied by another service of the app, but that would imply som digging.
Or the port assignments both for CPUs and the telemetry app can be modified to verify the success of assigning the port, and bumping the port it tries to acquire by one until either we run out of the port range or successfully assign.
I can sketch a fix for the telemetry app tonight, I am not sure if the CPUs need a fix or correctly assign (needs testing).