-
Notifications
You must be signed in to change notification settings - Fork 120
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
Duplicate massages #128
Comments
The UDP device also writes in batches because Ruby writes to sockets in batches. If you're seeing lots of duplicates, that means Ruby thought it couldn't write to the UDP socket and therefore threw an exception, and then LogStashLogger retried writing the whole batch. But in fact, the UDP packets were received on the listening side.
|
I'm confused with your answer. First I didn't see any exceptions regarding Ruby can't write to UDP socket. Secondly, even when I enabled Am I missing something? |
Logging exceptions are written to STDERR by default. Are you checking there?
I'll do some more research to see if it's normal/expected to get duplicate UDP packets on the receiving end even if the client only sent it once. I suspect that it is. |
Yes I'm checking The problem that I can get thousands duplicate messages. I mean one message can get written thousand times. I did I know |
That is indeed strange. It does appear that |
I use |
I tried a small test, and got the result I expected: logger = LogStashLogger.new(type: :udp, port: 5228)
loop { 10.times { logger.info(Time.now); sleep(0.1) }; logger.info('1'*100_000); }
E, [2017-05-13T14:55:40.690990 #16663] ERROR -- : [LogStashLogger::Device::UDP] Errno::EMSGSIZE - Message too long
W, [2017-05-13T14:55:40.691039 #16663] WARN -- : [LogStashLogger::Device::UDP] unrecoverable error, aborting write I was not able to reproduce duplicate log messages being sent. Long messages were correctly discarded. Can you post a few samples of the duplicate log messages? |
What version of Ruby are you using? In MRI 2.4.1, I get the error message |
Interesting... I just tried this test under JRuby and got Looks like version-specific error handling will be required. |
I'm using |
I can't reproduce this behavior in MRI 2.3.3. I suspect the behavior might be platform specific. What OS are you using? I test on a Macbook Pro. |
I run it in Docker container (Alpine Linux) on top of Debian distribution. I ran the same test and I see that the message always get retried:
|
The test above writes multiple large messages. If you just write one message, you'll see that it fails and never retries again. The It looks to me like you're getting the expected behavior when running my small test, but unexpected behavior in your actual web app. Do you have any extra configuration, gems, etc. that might contribute to the issue? |
Here are the configuration I use:
Also, I'm using |
Hi,
As I understand from docs, duplicate messages can happen for outputs that write in batches, like Kafka.
I'm using UDP output, and I still see lot's of duplicates.
Might be related, when I see duplicates I also see the following error:
ERROR -- : [LogStashLogger::Device::UDP] Errno::EMSGSIZE - Message too large
What could be the reason?
The text was updated successfully, but these errors were encountered: