You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2017/03/27 20:14:56 UTC

[1/2] couch-log commit: updated refs/heads/master to 194db1a

Repository: couchdb-couch-log
Updated Branches:
  refs/heads/master ad803f66d -> 194db1ade


Fix dns timeout for undefined syslog host

On some platforms, inet:getaddr can take several seconds to return when
passed the undefined atom, which is the default value of "syslog_host",
and therefore the value used when running tests. On platforms where it
takes longer to return than the test is allowed to run, the
couch_log_writer_syslog_test will fail with *timed out*.

This short circuits the case when "syslog_host" is undefined, and
removes the race from the test.

COUCHDB-3340


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/commit/24112cf6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/tree/24112cf6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/diff/24112cf6

Branch: refs/heads/master
Commit: 24112cf6ce9ed23029f7697b84548dc8acff28b5
Parents: ad803f6
Author: Jay Doane <ja...@gmail.com>
Authored: Sun Mar 26 23:46:15 2017 -0700
Committer: Jay Doane <ja...@gmail.com>
Committed: Sun Mar 26 23:46:15 2017 -0700

----------------------------------------------------------------------
 src/couch_log_writer_syslog.erl | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/blob/24112cf6/src/couch_log_writer_syslog.erl
----------------------------------------------------------------------
diff --git a/src/couch_log_writer_syslog.erl b/src/couch_log_writer_syslog.erl
index 738d162..d918bb7 100644
--- a/src/couch_log_writer_syslog.erl
+++ b/src/couch_log_writer_syslog.erl
@@ -46,13 +46,17 @@
 init() ->
     {ok, Socket} = gen_udp:open(0),
 
-    SysLogHost = config:get("log", "syslog_host"),
-    Host = case inet:getaddr(SysLogHost, inet) of
-        {ok, Address} when SysLogHost /= undefined ->
-            Address;
-        _ ->
-            undefined
-    end,
+    Host = case config:get("log", "syslog_host") of
+        undefined ->
+            undefined;
+        SysLogHost ->
+            case inet:getaddr(SysLogHost, inet) of
+                {ok, Address} ->
+                    Address;
+                _ ->
+                    undefined
+            end
+        end,
 
     {ok, #st{
         socket = Socket,


[2/2] couch-log commit: updated refs/heads/master to 194db1a

Posted by wo...@apache.org.
Merge branch '3340-fix-dns-timeout' of https://github.com/cloudant/couchdb-couch-log


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/commit/194db1ad
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/tree/194db1ad
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-log/diff/194db1ad

Branch: refs/heads/master
Commit: 194db1adeafd9d5b434ae22b06aecdcb8635863e
Parents: ad803f6 24112cf
Author: Joan Touzet <jo...@atypical.net>
Authored: Mon Mar 27 16:12:59 2017 -0400
Committer: Joan Touzet <jo...@atypical.net>
Committed: Mon Mar 27 16:12:59 2017 -0400

----------------------------------------------------------------------
 src/couch_log_writer_syslog.erl | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------