You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2019/08/08 21:07:22 UTC

[couchdb] 03/04: Increase default HTTP timeouts

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch jenkins-more-timeout-fixes
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit c98f06833c505d0da20b7a2d1fcc3d7eb0e70dc9
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Mon Jul 29 14:48:40 2019 -0400

    Increase default HTTP timeouts
    
    These are needed to avoid timeouts on ASF Jenkins build farm. The
    httpotion client uses ibrowse underneath, and ibrowse has three
    separate timeouts. We are configuring two of them here: the overall
    request timeout, and one that detects inactivity on the connection.
    We set them slightly differently just to be able to differentiate which
    one fired from the logs.
---
 test/elixir/lib/couch.ex | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/test/elixir/lib/couch.ex b/test/elixir/lib/couch.ex
index 58581b2..3c43ab1 100644
--- a/test/elixir/lib/couch.ex
+++ b/test/elixir/lib/couch.ex
@@ -50,6 +50,14 @@ defmodule Couch do
   CouchDB library to power test suite.
   """
 
+  # These constants are supplied to the underlying HTTP client and control
+  # how long we will wait before timing out a test. The inactivity timeout
+  # specifically fires during an active HTTP response and defaults to 10_000
+  # if not specified. We're defining it to a different value than the
+  # request_timeout largely just so we know which timeout fired.
+  @request_timeout 60_000
+  @inactivity_timeout 55_000
+
   def process_url("http://" <> _ = url) do
     url
   end
@@ -179,13 +187,13 @@ defmodule Couch do
       Keyword.get(
         options,
         :timeout,
-        Application.get_env(:httpotion, :default_timeout, 5000)
+        Application.get_env(:httpotion, :default_timeout, @request_timeout)
       )
 
     ib_options =
       Keyword.merge(
         Application.get_env(:httpotion, :default_ibrowse, []),
-        Keyword.get(options, :ibrowse, [])
+        Keyword.get(options, :ibrowse, [{:inactivity_timeout, @inactivity_timeout}])
       )
 
     follow_redirects =