Closed ianwsperber closed 7 years ago
Yeah that sounds right to me. Though I wouldn't technically call it a memory leak... more like a out of bounds buffer?
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
Though obviously an edge case, if a reporter configuration is set to an empty array (essentially blank) then good will write all log messages for that reporter to a stream that is never emptied, resulting in a memory leak. From what I can tell this is due to the check here https://github.com/hapijs/good/blob/master/lib/monitor.js#L128, which should add the
NoOp
stream according to the conditionstreamObjs.length <= 1
, notstreamObjs.length === 1
.I discovered this problem when I configured a dev mode only reporter, which in my confidence file was achieved by setting the reporter to an empty array. It was only in production that enough logs were generated to make the leak evident.
I am putting together a PR for this issue presently. However I will need to confirm this fixes the memory leak prior to creating the PR.