Closed ROSeaboyer closed 2 years ago
This isn't indeed a harmless warning but kind of annoying, it could be good to get rid of it.
I'm not 100% sure personally if we should increase the number of max listeners, or slightly refactor the code to avoid the warning. @pgrzesik any opinion on this?
Thanks a lot for reporting @ROSeaboyer - I'll look into it 💯
I think one thing we do wrong here is that we never remove the event listener once the child process has terminated. That might contribute to the "ever-increasing" number of event listeners.
I've looked into it and managed to reproduce the problem. @mnapoli you're right - we should be removing the listener there, however, the warning might still pop up e.g. in situation where there's a lot of services and they're are deployed in parallel - I think we might need to set the max listener number to at least the number of all services in Compose configuration.
ohh right that makes a lot of sense 👍
Are you certain it's a bug?
Are you using the latest version?
Is there an existing issue for this?
Issue description
When running a deployment with the below configuration, I get a MaxListenersExceededWarning when serviceD and serviceE start their deployment. This occurs regardless of which service of serviceB, serviceC, and serviceF finish deploying last.
Not the biggest deal, just something I thought I'd bring up.
node: 16.14.2 @serverless/compose: 1.0.2
Service configuration (serverless-compose.yml) content
Command name and used flags
serverless deploy --stage ryan
Command output