9990: Add configs for Workbench API client timeouts.
authorTom Clegg <tom@curoverse.com>
Thu, 8 Sep 2016 14:41:37 +0000 (10:41 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 28 Sep 2016 13:59:11 +0000 (09:59 -0400)
apps/workbench/app/models/arvados_api_client.rb
apps/workbench/config/application.default.yml

index fc9635bc65645d0885c108a8c1d6a935a3bd80de..eb93dfcfaa76d133635f8c55d429b1c00233bb37 100644 (file)
@@ -85,6 +85,9 @@ class ArvadosApiClient
     if not @api_client
       @client_mtx.synchronize do
         @api_client = HTTPClient.new
+        @api_client.ssl_config.timeout = Rails.configuration.api_client_connect_timeout
+        @api_client.connect_timeout = Rails.configuration.api_client_connect_timeout
+        @api_client.receive_timeout = Rails.configuration.api_client_receive_timeout
         if Rails.configuration.arvados_insecure_https
           @api_client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
         else
index 5400debbfdaf55e1f64c004adf70f98ca4037cb1..74d317bdf0ef3c537b0d10101568f377acc86395 100644 (file)
@@ -219,6 +219,10 @@ common:
   # Ask Arvados API server to compress its response payloads.
   api_response_compression: true
 
+  # Timeouts for API requests.
+  api_client_connect_timeout: 120
+  api_client_receive_timeout: 300
+
   # ShellInABox service endpoint URL for a given VM.  If false, do not
   # offer web shell logins.
   #