nitrictech / legacy-cli

CLI for the Nitric Framework
Apache License 2.0
6 stars 3 forks source link

Race condition on container and worker init causing container to fail #249

Open sleelin opened 2 years ago

sleelin commented 2 years ago

Environment details:

Working locally, almost all of my entrypoint containers are starting up, then stopping shortly after with the following logs:

Registered Gateway Plugin
Starting Child Process
Waiting for active workers
Services listening on: 127.0.0.1:50051
Membrane Error: available workers below required minimum of 1, 0 available, timedout waiting for more workers, exiting

The output of nitric run reports that all function entrypoints are running. We have defined our entrypoints as containers with a custom dockerfile, so I was able to work around this by adding ENV MIN_WORKERS=0 before the CMD line in the dockerfile.

After doing this the containers start properly with the following log:

Registered Gateway Plugin
Starting Child Process
Waiting for active workers
Starting Worker Supervisor
Services listening on: 127.0.0.1:50051
Starting Gateway, 0 workers currently available
Received init request from worker