<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi all,<div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 191); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 0); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; text-align: left; width: auto; direction: ltr; z-index: 99995; background-position: initial initial; background-repeat: initial initial; "></div><div><br></div><div>I installed rrdtool in a Centos 5.5 server , the rrdtool is accessed by a Java program through a socket:</div><div><br></div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;SocketAddress sa = new InetSocketAddress(config.getRrdServiceHost(), config.getRrdServicePort());</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Socket socket = new Socket();</div></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PrintWriter out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));</div></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;String command = StringUtils.join(new String[]{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"create", rrdFileRel,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"--start", Long.toString(timestamp - config.getStartTimeOffset()),</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"--step", "300",</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"DS:ds0:" + type + ":900:U:U",</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"RRA:AVERAGE:0.5:1:8640", // 1 month of real values (30d/300s=8640)</div></div><div><br></div><div><br></div><div>And the reply is read like this:</div><div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;out.println(command);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;out.flush();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;response = in.readLine();</div><div><br></div><div><br></div><div>The snippet above works most of the time, but for some reason after some dozens of graphics are generated the RRDTOOL closes unexpectedly the sockets it get invoked through, I alredy took a TCP-dump and it can observed hot the RRDTOOL is invoked successfully many times but&nbsp;unexpectedly&nbsp;closes the connection:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">create file:mycounter13180/stats.mycom.rrd --start 1286986228 --step 300 DS:ds0:ABSOLUTE:900:U:U ...</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">Reply:</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">OK u:0.00 s:0.01 r:0.01</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">But the last invocation fails:</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><meta http-equiv="content-type" content="text/html; charset=utf-8">create file:anothercounter13180/stats.mycom.rrd --start 1286986228 --step 300 DS:ds0:ABSOLUTE:900:U:U ...<br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">Reply:</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">none</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">Thus, the socket suddenly gets closed.</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">ERROR 2010-10-13 12:10:39,126 [ ] [stat-runner-1] com.colibria.imps.statistics.service.StatisticsService.run - Failed to read stat from imps nodes</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">java.net.SocketException: Connection reset</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.net.SocketInputStream.read(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.nio.cs.StreamDecoder.implRead(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.nio.cs.StreamDecoder.read(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.io.InputStreamReader.read(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.io.BufferedReader.fill(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.io.BufferedReader.readLine(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.io.BufferedReader.readLine(Unknown Source)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><br></span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at com.colibria.imps.statistics.service.StatisticsService.createRrdFile(StatisticsService.java:357)</span><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">&nbsp;</span></div><div><br></div></div><div>Please assist, thanks in advanced.</div><div><br></div><div>///RGB</div><div><br></div><div><br></div>                                               </body>
</html>