You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
at Elasticsearch.Net.HttpConnection.Request[TResponse](RequestData requestData)
at Elasticsearch.Net.RequestPipeline.CallElasticsearch[TResponse](RequestData requestData)
at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters)
at Serilog.Sinks.Elasticsearch.ElasticsearchSink.EmitBatchChecked[T](IEnumerable`1 events)
at Serilog.Sinks.Elasticsearch.ElasticsearchSink.EmitBatch(IEnumerable`1 events)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.EmitBatchAsync(IEnumerable`1 events)
In the end HttpConnection.Request is called synchronously, should not it be RequestAsync?
Hmm that implementation is pretty old and since we do IO operations, we could easily use the async parts. Unfortunately the EmitBatch is not async, but there is an EmitBatchAsync in the PeriodicBatchingSink base class. Might be nice to switch over to that implementation? I certainly welcome a PR!
HassanHashemi
changed the title
Why is elasticsearch sink using sync version of HttpContext.Request<TResponse> ?
Why is elasticsearch sink using sync version of HttpConnection.Request<TResponse> ?
Jul 29, 2020
So, I get following call stack in my logs
In the end
HttpConnection.Request
is called synchronously, should not it beRequestAsync
?https://github.com/elastic/elasticsearch-net/blob/b40781873a1d79a582944851c43189db0fc2aea2/src/Elasticsearch.Net/Connection/HttpConnection.cs#L78
It should be possible to call
async
version in avoid
method, as long as we handle exceptions carefully.I am OK with sending a PR if this change is fine?
@mivano
The text was updated successfully, but these errors were encountered: