Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocateMachinePort ¶
Reserves a unique port for a machine instance in a global (user) scope across all machines and backend types. On success the port is guaranteed to not be allocated until released with a call to ReleaseMachinePort().
The purpose of this method is to prevent collisions between machine instances when ran at the same time. Note, that dynamic port reassignment on its own is insufficient to resolve conflicts, since there is a narrow window between port detection and actual service binding, allowing for the possibility of a second racing machine to fail if its check is unlucky to fall within that window. Additionally, there is the potential for a long running reassignment dance over start/stop until all machine instances eventually arrive at total conflict free state. By reserving ports using mechanism these scenarios are prevented.
func IsLocalPortAvailable ¶
func ReleaseMachinePort ¶
Releases a reserved port for a machine when no longer required. Care should be taken to ensure there are no conditions (e.g. failure paths) where the port might unintentionally remain in use after releasing
Types ¶
This section is empty.