From 039982ac43bbb08ed4b86748e06dd012cba63dad Mon Sep 17 00:00:00 2001
From: jover <jochenverdeyen@gmail.com>
Date: Thu, 15 Jun 2017 14:14:40 +0200
Subject: [PATCH] Issue #2886438 by jover: Added connection timeout to
 ClusterManager's URL options

---
 src/ElasticSearch/ClientManager.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/ElasticSearch/ClientManager.php b/src/ElasticSearch/ClientManager.php
index 4c2bc14..20d2eb7 100644
--- a/src/ElasticSearch/ClientManager.php
+++ b/src/ElasticSearch/ClientManager.php
@@ -61,7 +61,9 @@ class ClientManager implements ClientManagerInterface {
           $cluster->getRawUrl(),
         ),
         'options' => array(),
-        'curl' => array(),
+        'curl' => array(
+          CURLOPT_CONNECTTIMEOUT => (!empty($cluster->options['timeout']) ? $cluster->options['timeout'] : Cluster::ELASTICSEARCH_CONNECTOR_DEFAULT_TIMEOUT)
+        ),
       );
 
       if ($cluster->options['use_authentication']) {
-- 
2.10.1 (Apple Git-78)

