Wizcorp / node-graylog2

Graylog2 client library for Node.js
Other
59 stars 36 forks source link

Random EADDRINUSE errors when logging #26

Closed FredrikL closed 7 years ago

FredrikL commented 7 years ago

Hi

I have a small problem with random crashes wit a EADDRINUSE error. The environment consists of multiple services run with pm2 and scripts started from cron. In both cases i see errors once or twice per day. The error is as below.

bind EADDRINUSE 0.0.0.0
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at dgram.js:221:18
    at _combinedTickCallback (internal/process/next_tick.js:77:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

I haven't been able to confirm it but from the dgram docs I think it might be solve by setting reuseAddr to true

ronkorving commented 7 years ago

The problem may be more related to your environment than this library. However, I can imagine using reuseAddr would "solve" (ie: work around) your problem.

So, a reuseAddr boolean could be introduced to the config object passed to the constructor, but I would still argue that you probably want to investigate your setup.

Perhaps @stelcheck has anything to add to this?

FredrikL commented 7 years ago

Sorry, seems to be a fault on my end, found a function that didn't close the logger after use seems to have been the problem