Closed Meiri closed 3 years ago
Looks like a bug. We switched from our own MemoryTransport
implementation to the one in ApacheThrift
. Maybe they are not behaving the same.
I will give it a look the next hours.
@Meiri Thanks for your report. This was leading to a memory leak. I fixed it on the PR and will release it as 1.0.2
as soon it's reviewed since it's a critical bug.
I just released v1.0.2
which should resolve your issue. If you still run into issues, let us know!
happy to help, thanks for the quick response
im not sure its a bug, might be missing/wrong config
span size keep increasing in ThriftSender/AppendAsync
Steps to reproduce the behavior:
in startup config: `(serviceProvider =>
{
var serviceName = serviceProvider.GetRequiredService().ApplicationName;
var loggerFactory = serviceProvider.GetRequiredService();
services.AddOpenTracing(builder => { builder.ConfigureAspNetCore(options => { options.Hosting.IgnorePatterns.Add(x => { return x.Request.Method == "GET"; }); options.Hosting.IgnorePatterns.Add(x => { return x.Request.Path == "/metrics"; }); }); }); services.AddSingleton
the issue is in the thrift sender base, in the getsize function
public int GetSize(TBase thriftBase) { _memoryTransport.Length = 0; thriftBase.WriteAsync(ProtocolFactory.GetProtocol(_memoryTransport), CancellationToken.None).GetAwaiter().GetResult(); return _memoryTransport.Length; }
my "fix" was to use a local variable instead of _memoryTransport
public int GetSize(TBase thriftBase) { using (var memoryTransport = new TMemoryBufferTransport(new TConfiguration())) { thriftBase.WriteAsync(ProtocolFactory.GetProtocol(memoryTransport), CancellationToken.None).GetAwaiter().GetResult(); return memoryTransport.Length; } }
im not sure its a bug, maybe config issue.