SkyAPM-dotnet
SkyAPM-dotnet copied to clipboard
A large number of httpclients and tcp are created when the oap server is unavailable
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
- [x] Bug
- [ ] Requirement
- [ ] Feature or performance improvement
Bug
Here's the problem:
https://github.com/SkyAPM/SkyAPM-dotnet/blob/7e7693dd7ad692f2e52037232dc741dad6a71cd4/src/SkyApm.Transport.Grpc/ConnectionManager.cs#L58-L61
It is executed every 15 seconds. At this time, it is offline and the GrpcChannel is recreated. Each time the GrpcChannel is created, a new httpclient instance will be created.
Optional fixes:
Provide your own httpclient for GrpcChannel and reuse httpclient instances.
In addition, ShutdownAsync does not seem to be implemented?

@liuhaoyang There is a repair plan?
@liuhaoyang
I tried to process and found that the httpclient created when based on netstandard 2.0 is not available. If I reuse it directly_ Channel doesn't seem to be rebuilding Tongtong.
我尝试处理发现在基于netstandard2.0时创建的httpclient不可用,如果直接复用_channel 似乎不会重建通通。
@liuhaoyang I tried to process and found that the httpclient created when based on netstandard 2.0 is not available. If I reuse it directly_ Channel doesn't seem to be rebuilding Tongtong.
我尝试处理发现在基于netstandard2.0时创建的httpclient不可用,如果直接复用_channel 似乎不会重建通通。
It may be better to release the old connection completely when retrying the gRPC connection
@liuhaoyang 请问这个问题解决了嘛?(oap服务挂掉后会创建大量httpclient、tcp连接)🙏