-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Networking & Observability
When starting the gRPC server, we call AddListeningPort on each provided address, which fills in the boundPorts array with the ports gRPC will use. We then update our own mapping of gRPC listening addresses by capturing each address from _options.addresses as a reference and rewriting that memory to use the newly populated port in boundPorts. These two pieces of startup code and not clearly related, and it is easy to miss that we are rewriting the reference in the map, which can lead to confusion when reading the startup code.
We should add a comment explaining this logic.