Closed Sirozha1337 closed 3 weeks ago
Can you confirm the version of the library being used ? We do have retry logic in place for connection failures (StatusCode.Unavailable
)
Can you confirm the version of the library being used ? We do have retry logic in place for connection failures (
StatusCode.Unavailable
)
The latest one - 6.2.0-beta
I've managed to fix this problem by providing SocketsHttpHandler
configured with timeouts in configureChannelOptions
:
new EtcdClient(_options.ConnectionString, _options.Port, configureChannelOptions:
channelOptions =>
{
var handler = new SocketsHttpHandler();
handler.KeepAlivePingDelay = TimeSpan.FromSeconds(30);
handler.KeepAlivePingTimeout = TimeSpan.FromSeconds(30);
handler.KeepAlivePingPolicy = TimeSpan.FromSeconds(30);
channelOptions.HttpHandler = handler;
channelOptions.ThrowOperationCanceledOnCancellation = true;
})
Default handler doesn't ping the connection, so it doesn't know that etcd is down. With this configuration it will send ping packets every 30 seconds and if they timeout it will throw an exception.
Thank you. That is a good recommendation, will see if some ideal defaults fits in.
@shubhamranjan did you manage to incorporate this improvement in the recent version?
Describe the bug
Restarting a server with running etcd breaks watch in services running on other servers.
To Reproduce
Expected behavior WatchRange should throw an error, just like it does when etcd server is restarted.
Additional context It seems the problem is the difference between service shutdown and server shutdown: