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

File handles leak #19

Open
BenoitMercier opened this issue Jan 1, 2022 · 0 comments
Open

File handles leak #19

BenoitMercier opened this issue Jan 1, 2022 · 0 comments

Comments

@BenoitMercier
Copy link

BenoitMercier commented Jan 1, 2022

It looks like whenever there's a write to the log, a file handle is consumed and never recovered. After a while, file handles are exhausted.

Here's how I'm using it:

logger.add(function() {
	return new (winstonGraylog)({
		name: 'Graylog',
		level: logLevelGreylog,
		silent: false,
		handleExceptions: true,
		humanReadableUnhandledException: false,
		exceptionsLevel: 'error',
		baseMsg: {
			host: hostname,
			facility: loggerParams.facility,
			app: loggerParams.appRouting
		},
		gelfPro: {
			adapterName: 'udp',
			adapterOptions: {
				host: config.greyloghost,
				port: parseInt(config.greylogport)
			}
		}
	})
})

At the os level, "lsof -p [pid] | wc -l" will show an increasing amount of opened sockets on each writes to the log.
Same goes for "ls -l /proc/[pid]/fd | wc -l"

Using 1.0.13, there are no problems
At 1.0,14 and 1.0.15, the above code won't run. I get: error: uncaughtException: winstonGraylog is not a constructor
At 1.0.16 and 1.0.17, this is when I see the problem with file handles being consumed indefinetely,

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