microsoft / parallel-prettier

Concurrent prettier runner
MIT License
197 stars 18 forks source link

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Worker] #7

Closed trivikr closed 3 years ago

trivikr commented 3 years ago

I noticed this issue while running parallel-prettier on ~16000 files in https://github.com/aws/aws-sdk-js-v3/pull/1949

System Information * Operating System: Amazon Linux 2 x86_64 * Host type: c5.4xlarge (16 Virtual CPUs, 32.0 GiB Memory, 160 GiB SSD (EBS) Storage) * Node.js version: v14.15.4

Command run was equivalent to:

node --trace-warnings ./node_modules/.bin/pprettier --write **/*.{ts,js,md,json}
(node:697) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Worker]. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:390:17)
    at Worker.addListener (events.js:406:10)
    at setupSubscription (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/observable/fromEvent.js:38:19)
    at Observable._subscribe (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/observable/fromEvent.js:25:9)
    at Observable._trySubscribe (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/Observable.js:30:22)
    at MapOperator.call (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/operators/map.js:32:23)
    at Observable.subscribe (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/Observable.js:25:31)
    at FilterOperator.call (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/operators/filter.js:29:23)
    at Observable.subscribe (/local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/rxjs/internal/Observable.js:25:31)

The error appears around 16 times, equal to number of virtual CPUs.

connor4312 commented 3 years ago

Thanks for the issue. This is not particularly concerning if files are read faster than they are formatted. But I will take care of it.

connor4312 commented 3 years ago

Published in 2.0.1