-
Notifications
You must be signed in to change notification settings - Fork 75
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
TCP input miss data #51
Comments
I don't know what this means: Can you attach a sample pcap or data set? |
It's mean, that batch-size for workers in logstash configured by default, it's 125 events or something, when i increased batch size bug dissapiared. |
How to solve the problem |
@jordansissel hmmmmm :) I tried implementing the plugin in a single threaded nonblocking way this morning, but this one is a huge blocker and I'm not sure how to deal with it. The problem here is this (in the current implementation): We decode events from the incoming stream like so:
To me, it looks like this approach is just working by accident at the moment, mainly due to the fact that we do blocking reads. Of cause, if we block and clients are sending events one by one, all is well, as long as the connection is super stable and you have enough cores so that you "never miss a read".
socket.puts("PROXY TCP4 1.2.3.4 5.6.7.8 1234 5678\r");
socket.flush
event_count.times do |i|
# unicode smiley for testing unicode support!
socket.puts("#{i} ☹")
socket.flush (flushing forcefully constantly is necessary)
Do you have any guidance on how to approach this? To me, it feels like I need to know the length of an event so that I can feed it to our codecs if I want to fix the partial read case. The multiple events in a single read case is easy, I can just carry over the buffered bytes after decoding. But how do I detect if the beginning of my buffer does not contain a full event but only the beginning of one? |
This seems like something milling would solve? elastic/logstash/issues/4858 elastic/logstash/issues/5124 But here wouldn't a codec such as |
@colinsurprenant This one was actually solved in the end with the help of Jordan. That was just me not understanding how buffers work fully back then + there being an actual bug in the old implementation. Fixed by the move to Netty/Java now :) |
I'm using tcp input to accept logs in json from other services. There is a bug, if you leave parameter -b default, and try send to socket 40-50k json logs w/o any timeouts, you will get a few invalid jsons and json parse error in logstash. Looks like tcp input don't finish with reading whole line till \n and concatenate it with the next one line till the next one \n
The text was updated successfully, but these errors were encountered: