Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Conversation

JensRantil
Copy link

WIP.

Almost complete pull request to fix #7. Just need to write a test for it. Most of the groundwork to run the test is already done. It's simply a matter of writing one.

I do not intend to finish this pull request myself since I no longer intend to use metrics-statsd. However, I am willing to answer any questions you might have about this pull request.

@gangaaloori
Copy link

@JensRantil Thanks for this pull request. Limitation on the size of UDP packet is a serious issue when you need to send large monitoring data. We're using the current version of this in one of our project, we are facing exactly the same problem.
Code works fine up to some point and at some point, where the monitoring data exceeds the packet size, it just stops working without logging the exception details.Unfortunately logging is poor(inapprpriate logging levels), swallows the exceptions. I had modified the code a bit to see the exception details and this is what I got

19:40:38.212 [metrics-statsd-reporter-thread-1] INFO  com.bealetech.metrics.reporting.Statsd - Metrics output size by StatsD writer :: 68924
19:40:38.213 [metrics-statsd-reporter-thread-1] ERROR c.b.metrics.reporting.StatsdReporter - Error disconnecting from StatsD server
java.io.IOException: Message too long
        at java.net.PlainDatagramSocketImpl.send(Native Method) ~[na:1.7.0_65]
        at java.net.DatagramSocket.send(DatagramSocket.java:676) ~[na:1.7.0_65]
        at com.bealetech.metrics.reporting.Statsd.close(Statsd.java:85) ~[metrics-statsd-3.0.0-SNAPSHOT.jar!/:na]
        at com.bealetech.metrics.reporting.StatsdReporter.report(StatsdReporter.java:162) ~[metrics-statsd-3.0.0-SNAPSHOT.jar!/:na]
        at com.bealetech.metrics.reporting.StatsdScheduledReporter.report(StatsdScheduledReporter.java:130) [metrics-statsd-3.0.0-SNAPSHOT.jar!/:na]
        at com.bealetech.metrics.reporting.StatsdScheduledReporter$1.run(StatsdScheduledReporter.java:100) [metrics-statsd-3.0.0-SNAPSHOT.jar!/:na]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [na:1.7.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.7.0_65]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]

@JensRantil
Copy link
Author

@ganga-aloori Have you tried lowering DEFAULT_MAX_UDP_PACKET_SIZE? Could be the culprit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants