[rrd-users] rrdtool unexpectedly closes socket

Gerardo Corro rob_gar_esp at hotmail.com
Wed Oct 13 18:41:15 CEST 2010

Hi all,
I installed rrdtool in a Centos 5.5 server , the rrdtool is accessed by a Java program through a socket:

        SocketAddress sa = new InetSocketAddress(config.getRrdServiceHost(), config.getRrdServicePort());        Socket socket = new Socket();        BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));        PrintWriter out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));        String command = StringUtils.join(new String[]{                "create", rrdFileRel,                "--start", Long.toString(timestamp - config.getStartTimeOffset()),                "--step", "300",                "DS:ds0:" + type + ":900:U:U",                "RRA:AVERAGE:0.5:1:8640", // 1 month of real values (30d/300s=8640)

And the reply is read like this:        out.println(command);        out.flush();        response = in.readLine();

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 unexpectedly closes the connection:
create file:mycounter13180/stats.mycom.rrd --start 1286986228 --step 300 DS:ds0:ABSOLUTE:900:U:U ...
OK u:0.00 s:0.01 r:0.01 

But the last invocation fails: 

create file:anothercounter13180/stats.mycom.rrd --start 1286986228 --step 300 DS:ds0:ABSOLUTE:900:U:U ...

Thus, the socket suddenly gets closed. 
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 
java.net.SocketException: Connection reset 
        at java.net.SocketInputStream.read(Unknown Source) 
        at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) 
        at sun.nio.cs.StreamDecoder.implRead(Unknown Source) 
        at sun.nio.cs.StreamDecoder.read(Unknown Source) 
        at java.io.InputStreamReader.read(Unknown Source) 
        at java.io.BufferedReader.fill(Unknown Source) 
        at java.io.BufferedReader.readLine(Unknown Source) 
        at java.io.BufferedReader.readLine(Unknown Source) 
        at com.colibria.imps.statistics.service.StatisticsService.createRrdFile(StatisticsService.java:357) 
Please assist, thanks in advanced.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20101013/a05c713b/attachment-0001.htm 

More information about the rrd-users mailing list