-
Notifications
You must be signed in to change notification settings - Fork 174
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
List of Events grows indefinitely when one Event contains null message in HttpSender #190
Comments
A for (HttpEventCollectorEventInfo eventInfo : events) {
eventsBatchString.append(serializer.serialize(eventInfo)); // throws NullPointerException on a 'null' Reference in eventInfo.message
} In our case the thrown As @nbetten mentioned above, the |
So my idea was that faulty public synchronized void send(
final String severity,
final String message,
final String logger_name,
final String thread_name,
Map<String, String> properties,
final String exception_message,
Serializable marker
) {
String eventMessage = message == null ? "" : message;
// create event info container and add it to the batch
HttpEventCollectorEventInfo eventInfo =
new HttpEventCollectorEventInfo(severity, eventMessage, logger_name, thread_name, properties, exception_message, marker);
eventsBatch.add(eventInfo);
eventsBatchSize += severity.length() + eventMessage.length();
if (eventsBatch.size() >= maxEventsBatchCount || eventsBatchSize > maxEventsBatchSize) {
flush();
}
} |
As for now I will propose a solution to the Splunk Maintainers, since no other ideas were suggested. |
Fixed in #195, waiting to be merged |
We have encountered a problem in one of our applications with the heap overflowing caused by stuck Splunk messages. We have analyzed the problem and verified that it is caused by a faulty Layout that fails to serialize some Object properly before passing them on.
The problem chain starts at the method
send(...)
in theHttpEventCollectorSender
as seen below with comments indicating the problem. Whensend(...)
is called with a message that contains a null reference, theHttpEventCollectorEventInfo()
gets added to the list of events. However this causes theHttpEventCollectorSender
to fail upon send, causing the list to grow with no flushing thereafter.When calling flush with a malformed event flush always fails causing the heap to explode. This is caused by the code snippet at the bottom
Events can not get posted because serialization fails if a
Layout
generates a faulty event.The text was updated successfully, but these errors were encountered: