知道什么时候
长距离跑
ElasticSearch请求完成了吗?
今天,我有一个进程周期性地从一个AWS托管的ES中清除大约10万个文档,其中包含大约6000万个文档。
var settings = new ConnectionSettings(new Uri("https://mycompany.es.aws.com"));
settings.RequestTimeout(TimeSpan.FromMinutes(3)); // not sure this helps
var client = new ElasticClient(settings);
var request = new DeleteByQueryRequest("MyIndex") { ... };
// this call will return an IsValid = true, httpstatus = 504 after ~60s,
var response = await client.DeleteByQueryAsync(request);
即使超时设置为3分钟,调用也始终在~60秒后返回,响应为空,状态代码为504。虽然通过Kibana,我可以看到删除操作在接下来的几分钟内继续(并正确完成)。
有没有更好的方法来请求和监视(等待完成)长时间运行的ES请求?