-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
The services launcher reports the requested port regardless of which port was actually allocated by the operating system.
When launching several service instances on the same machine, it is better to allow the OS to dynamically choose a port from the IANA ephemeral range, than to guess at what port numbers haven't been used. Tornado will happily bind an ephemeral port if port 0 is requested.
To verify that this works with poppy-services, run
$ poppy-services --poppy-simu --http --http-port 0 poppy-ergo-jr &
$ sleep 10 ; ss -tlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:42961 0.0.0.0:* users:(("poppy-services",pid=70,fd=7))
LISTEN 0 128 [::]:42961 [::]:* users:(("poppy-services",pid=70,fd=8))
The services launcher should retrieve the list of bound sockets from Tornado, instead of reporting the port that was requested
pypot/pypot/creatures/services_launcher.py
Line 218 in 3cab4f4
| if args.http or args.poppy_simu: msg+= ' http_port={},'.format(args.http_port) |
Metadata
Metadata
Assignees
Labels
No labels