Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process exit listeners are leaking #27

Open
qtiki opened this issue Mar 10, 2019 · 1 comment
Open

Process exit listeners are leaking #27

qtiki opened this issue Mar 10, 2019 · 1 comment

Comments

@qtiki
Copy link

qtiki commented Mar 10, 2019

Process exit listeners aren't removed properly when the child process exits. This leads to a node warning once you start and stop the offline DynamoDB more than 10 times:

(node:9960) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit

The listener seems to be registered here:

process.on('exit', function() {

@qtiki
Copy link
Author

qtiki commented Mar 10, 2019

Here's code to reproduce:

const db = require('dynamodb-local');

async function test() {
	for (let i = 0; i < 11; i++) {
		await db.launch(8000, null, ['-inMemory'], true);
		db.stop(8000);
	}
}

test();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant