jaegertracing / jaeger-client-csharp

🛑 This library is DEPRECATED!
https://jaegertracing.io/
Apache License 2.0
302 stars 67 forks source link

RemoteReporter.cs blocking code issue #189

Closed BojanPantovic1989 closed 4 years ago

BojanPantovic1989 commented 4 years ago

Hello guys,

First of all, thank you for all the work on this library. We are using Jaeger and it's a life saver. Recently, we had some issues with performance and during the analyses we found that jaeger C# is blocking our thread.

In our case, we have a .net core application inside a docker container, on a k8s cluster. When we put a limit on the container to be exactly 1 CPU, we see some performance issues. After several investigations, one of the things we found out, is that we have thread blocking on jaeger code.

JaegerBlockingTrace

After looking at the source code, I think this could easily be avoided. My proposal is to change the method ProcessQueueLoop() in RemoteReporter.cs to be async, so that when command.ExecuteAsync() is called it can be awaited and not to use Wait which is blocking.

Also, the StartNew code could be replaced with

_queueProcessorTask = Task.Run(async () => { await ProcessQueueLoop(); });

Falco20019 commented 4 years ago

Hi @BojanPantovic1989 and thanks for finding this issue. I will give it a look the next days. I just came back from vacation and have to look into some other topics first. Feel free to create a PR yourself addressing this issue to speed it up if you have time.

EngRajabi commented 4 years ago

Do not publish the version ?? We have a problem with version 0.4.1