If Logentries connection fails, unbounded memory growth occurs, causing potential crash and loss of logs #1

Closed
markstos opened this Issue Jun 18, 2015 · 3 comments

Projects

None yet

2 participants

@markstos

It appears that if the connection to Logentries fails, waiting logs are pushed on to an in-memory queue. When the connection starts working again, the queue is flushed.

However, I see no bound on the queue size. Eventually the memory growth of buffered logs could exhaust system memory and cause a crash, taking the buffered logs with it.

The issue could be addressed by putting a limit on the queue size, and making sure that buffered logs beyond the queue size are logged to STDERR as a backup option. This is generally approach that the official Logentries client](https://github.com/logentries/le_node) takes.

@No9
Owner
No9 commented Jun 18, 2015

@markstos thanks for such a clear report and your interest.

If we bump the dependency to le_node I think that would produce the effect you are looking for.
The internal lib is https://github.com/rjrodger/node-logentries which now directs to le_node.

TBH this could do with a some house keeping anyway.

@No9
Owner
No9 commented Jun 19, 2015

Updated here 22e15c7

The stream now emits errors which according to this documentation you can put to stderr as you suggested.
https://github.com/logentries/le_node#buffer--connection-issues

@No9
Owner
No9 commented Jul 14, 2015

k I am going to close this off as the patch answers the original issue

@No9 No9 closed this Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment