-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Hi @Mpdreamz,
We have an app that uses the thriftconnection to talk with elastic-server (es-sever).
We noticed that if es-server is unreachable the client takes long to timeout.
After some checks we changed the Thrift.Transport-socket-sconnect to "honor" the timeout property in the connection settings.
ConnectionSettings.SetTimeout(1000)
Modified the client connect code from:
namespace Elasticsearch.Net.Connection.Thrift.Transport
public class TSocket
{
public override void Open()
{
...
client.Connect(host, port);
}
to:
public override void Open()
{
...
var result = client.BeginConnect(host, port, null, null);
var sucess = result.AsyncWaitHandle.WaitOne(timeout);
if (!sucess)
{
throw new Exception("Failed to connect");
}
}
What are your thought on this?
Metadata
Metadata
Assignees
Labels
No labels