Skip to content

File handles leak #19

@BenoitMercier

Description

@BenoitMercier

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions