StatsDOutputWriter - Given data too big for the buffer size
See original GitHub issuejmxtrans-agent-1.2.4.jar StatsDOutputWriter is indefinitelly failing with “java.nio.BufferOverflowException”. It seems error was triggered by random failed DNS resolution, that caused some buffer (lim=91) to fill up.
2017-03-07 03:19:29.614 SEVERE [jmxtrans-agent-1] org.jmxtrans.agent.StatsDOutputWriter - Could not send stat java.nio.HeapByteBuffer[pos=0 lim=91 cap=1024] to host telegraf:8125
java.io.IOException: Target address not resolved
at sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:425)
at org.jmxtrans.agent.StatsDOutputWriter.flush(StatsDOutputWriter.java:157)
at org.jmxtrans.agent.StatsDOutputWriter.doSend(StatsDOutputWriter.java:128)
at org.jmxtrans.agent.StatsDOutputWriter.writeQueryResult(StatsDOutputWriter.java:118)
at org.jmxtrans.agent.OutputWriterCircuitBreakerDecorator.writeQueryResult(OutputWriterCircuitBreakerDecorator.java:90)
at org.jmxtrans.agent.Query.processAttributeValue(Query.java:274)
at org.jmxtrans.agent.Query.collectAndExportAttribute(Query.java:239)
at org.jmxtrans.agent.Query.collectAndExportForObjectName(Query.java:173)
at org.jmxtrans.agent.Query.collectAndExport(Query.java:167)
at org.jmxtrans.agent.TimeTrackingCollector.collectIfEnoughTimeHasPassed(TimeTrackingCollector.java:54)
at org.jmxtrans.agent.JmxTransExporter.collectAndExport(JmxTransExporter.java:209)
at org.jmxtrans.agent.JmxTransExporter$2.run(JmxTransExporter.java:131)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
2017-03-07 03:19:29.614 WARNING [jmxtrans-agent-1] org.jmxtrans.agent.StatsDOutputWriter - Given data too big (98bytes) for the buffer size (91bytes), skip it: jmxtransagents.xx...
2017-03-07 03:19:29.615 WARNING [jmxtrans-agent-1] org.jmxtrans.agent.Query - Exception collecting java.lang:type=OperatingSystem#MaxFileDescriptorCount
java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:183)
at java.nio.ByteBuffer.put(ByteBuffer.java:832)
at org.jmxtrans.agent.StatsDOutputWriter.doSend(StatsDOutputWriter.java:136)
at org.jmxtrans.agent.StatsDOutputWriter.writeQueryResult(StatsDOutputWriter.java:118)
at org.jmxtrans.agent.OutputWriterCircuitBreakerDecorator.writeQueryResult(OutputWriterCircuitBreakerDecorator.java:90)
at org.jmxtrans.agent.Query.processAttributeValue(Query.java:274)
at org.jmxtrans.agent.Query.collectAndExportAttribute(Query.java:239)
at org.jmxtrans.agent.Query.collectAndExportForObjectName(Query.java:173)
at org.jmxtrans.agent.Query.collectAndExport(Query.java:167)
at org.jmxtrans.agent.TimeTrackingCollector.collectIfEnoughTimeHasPassed(TimeTrackingCollector.java:54)
at org.jmxtrans.agent.JmxTransExporter.collectAndExport(JmxTransExporter.java:209)
at org.jmxtrans.agent.JmxTransExporter$2.run(JmxTransExporter.java:131)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
...
2017-03-07 08:26:33.896 WARNING [jmxtrans-agent-1] org.jmxtrans.agent.StatsDOutputWriter - Given data too big (104bytes) for the buffer size (91bytes), skip it: jmxtransagents.xx...
2017-03-07 08:26:33.896 WARNING [jmxtrans-agent-1] org.jmxtrans.agent.Query - Exception collecting java.lang:type=OperatingSystem#SystemCpuLoad
java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:183)
at java.nio.ByteBuffer.put(ByteBuffer.java:832)
at org.jmxtrans.agent.StatsDOutputWriter.doSend(StatsDOutputWriter.java:136)
at org.jmxtrans.agent.StatsDOutputWriter.writeQueryResult(StatsDOutputWriter.java:118)
at org.jmxtrans.agent.OutputWriterCircuitBreakerDecorator.writeQueryResult(OutputWriterCircuitBreakerDecorator.java:90)
at org.jmxtrans.agent.Query.processAttributeValue(Query.java:274)
at org.jmxtrans.agent.Query.collectAndExportAttribute(Query.java:239)
at org.jmxtrans.agent.Query.collectAndExportForObjectName(Query.java:173)
at org.jmxtrans.agent.Query.collectAndExport(Query.java:167)
at org.jmxtrans.agent.TimeTrackingCollector.collectIfEnoughTimeHasPassed(TimeTrackingCollector.java:54)
at org.jmxtrans.agent.JmxTransExporter.collectAndExport(JmxTransExporter.java:209)
at org.jmxtrans.agent.JmxTransExporter$2.run(JmxTransExporter.java:131)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to set the buffer size on a BufferedWriter over a FileWriter
Trying to open already opened file. · Lines might be cut and mixed. · No flushing and closing buffers will mean (the tail...
Read more >StatsDOutputWriter.java example - Javatips.net
This class describes the usage of StatsDOutputWriter.java. ... 1)) { logger.warning("Given data too big (" + data.length + "bytes) for the buffer size...
Read more >15.3. Large Data Rates — Fast DDS 2.9.0 documentation
The solution is to increase the buffers size. It is also possible to limit the rate at which the Publisher sends data using...
Read more >CWE-131: Incorrect Calculation of Buffer Size (4.9) - MITRE
The software does not correctly calculate the size to be used when ... Executing the above code could result in a buffer overflow...
Read more >Determining the max allowable buffer size - Oracle Communities
I'd like to design it in a way so that I could allocate as big of a memory buffer as I can, read...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released in 1.2.6
@cyrille-leclerc Are there plans for making an official release with this fix in it? We are seeing this issue a lot and it would be good to have an official release rather than us relying on a random snapshot build. This has been really useful for us, so keep up the good work! 🥇