projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
733f11a
)
redis plugin: Check for / report connection errors
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Sun, 17 Jun 2018 09:10:54 +0000
(16:10 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Sun, 17 Jun 2018 12:13:39 +0000
(19:13 +0700)
src/redis.c
patch
|
blob
|
history
diff --git
a/src/redis.c
b/src/redis.c
index
68158ed
..
9568fc5
100644
(file)
--- a/
src/redis.c
+++ b/
src/redis.c
@@
-423,8
+423,13
@@
static int redis_read(void) /* {{{ */
rh = redisConnectWithTimeout((char *)rn->host, rn->port, rn->timeout);
if (rh == NULL) {
- ERROR("redis plugin: unable to connect to node `%s' (%s:%d).", rn->name,
- rn->host, rn->port);
+ ERROR("redis plugin: can't allocate redis context");
+ continue;
+ }
+ if (rh->err) {
+ ERROR("redis plugin: unable to connect to node `%s' (%s:%d): %s.",
+ rn->name, rn->host, rn->port, rh->errstr);
+ redisFree(rh);
continue;
}