Port allocation seems to fail in a Docker Swarm without port binding
claustres opened this issue · 2 comments
Steps to reproduce
Deploy an application in a docker swarm cluster without port binding.
Expected behavior
Port allocation should work.
Actual behavior
It appears the application hangs during port allocation in the portfinder module. The app tries to find free port for a long time because thousands of ports are checked. Adding a port binding makes the app work as expected, port allocation stops after a couple of tries (as expected because we have a couple of services too). It appears that a new host name is added to the host names list in this case.
This is for an application providing services to another one. For the consumer application it works without port binding.
System configuration
Module versions (especially the part that's not working): 0.7
NodeJS version: 8.16
Operating System: Docker
Although the port binding fixes the problem with an app consuming services and an app producing services it breaks again when there is an additional app consuming services of both others apps.