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

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

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

This comment has been minimized.

Show comment
Hide comment
@No9

No9 Jun 18, 2015

Owner

@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.

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

This comment has been minimized.

Show comment
Hide comment
@No9

No9 Jun 19, 2015

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@No9

No9 Jul 14, 2015

Owner

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

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