-
Notifications
You must be signed in to change notification settings - Fork 13
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
How to Send Large Messages: Process Out of Memory Thrown #15
Comments
Can you create a repro for this? |
How would I go about doing that? My graylog server isn't public. Do you have a graylog server to run against? |
You can't reproduce against localhost? What sort of messages are you sending? |
The concern that "logging should never throw" is also a bit of a red herring – if your process is running out of memory, and it just happens to be when gelf-stream is allocating, then that's not an issue with gelf-stream – there's nothing gelf-stream can do to prevent that (especially if you're sending very large messages/objects). It's only an issue with gelf-stream if it's leaking memory in some way. |
I am getting the same problem, it seems to happen on complex nested objects, because on simple string or object it works |
@Migo2014 is it a recursive object of some kind? |
yes, I wrote too early, sorry. It's mongoose objects that make it crash, since it worked on regular bunyan, I didn't think about it. |
After crashes in production and a long investigation I found that the flatten() does not detect circular references and generates a infinite recursion. This is a big problem because as @pixelshaded mentioned the logger should never throw but crashing your process is even more serious. Basically there are no checks of circular references in flatten():
I think is important to be able to opt-in for flatten and not be obliged to use it. I prefer using a Graylog extractor instead. This is related: #11 Here is a workaround:
|
It seems that bunyan-gelf has the same problem: hughsk/flat#24 (comment) |
@pixelshaded Can you please change the title to something like "Crashes process when serializing objects with circular references: process out of memory" to be more precise? |
Getting this in stdout
This scares me only because logging should never throw and it brings down the whole server.
The text was updated successfully, but these errors were encountered: