diff --git a/src/Connections/Elasticsearch.Net.Connection.Thrift/ThriftConnection.cs b/src/Connections/Elasticsearch.Net.Connection.Thrift/ThriftConnection.cs index 7798fbbcbd9..4bb5ea57708 100644 --- a/src/Connections/Elasticsearch.Net.Connection.Thrift/ThriftConnection.cs +++ b/src/Connections/Elasticsearch.Net.Connection.Thrift/ThriftConnection.cs @@ -323,6 +323,11 @@ private ElasticsearchResponse Execute(RestRequest restRequest, object de client.InputProtocol.Transport.Close(); throw; } + catch (TTransportException) + { + client.InputProtocol.Transport.Close(); + throw; + } finally { //make sure we make the client available again.