Skip to content

Commit

Permalink
Fix bug for carbon timeout.
Browse files Browse the repository at this point in the history
While trying to modify carbon_timeout using gmetad.conf
noticed timeout wasn't affecting actual socket timeout.
this was due to a bug in rrd_helpers.c while checking the
configuration value of the carbon_timeout variable in
gmetad.conf
and relying on the default 500 ms value.

Credit for the discovery of the bug goes to Leonid
Mirsky <leonidlm@gmail.com>
  • Loading branch information
omris authored and vvuksan committed Nov 14, 2012
1 parent 1c1c2d9 commit 735ce43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gmetad/rrd_helpers.c
Expand Up @@ -243,12 +243,17 @@ push_data_to_carbon( char *graphite_msg)
int port;
int carbon_socket;
struct sockaddr_in server;
int carbon_timeout = 500;
int carbon_timeout ;
int nbytes;
struct pollfd carbon_struct_poll;
int poll_rval;
int fl;

if (gmetad_config.carbon_timeout)
carbon_timeout=gmetad_config.carbon_timeout;
else
carbon_timeout = 500;

if (gmetad_config.carbon_port)
port=gmetad_config.carbon_port;
else
Expand Down

0 comments on commit 735ce43

Please sign in to comment.