opentracing/opentracing-python

No cap on number of active scopes or spans

isaaczinda opened this issue · 0 comments

The following code, which could have easily been written by mistake, creates an arbitrary number of spans which are never ended and take up enormous amount of memory. Python OpenTracing should have limit the number of open scopes / spans a user can have to prevent a small mistake from becoming an enormous memory leak.

from opentracing.mocktracer import MockTracer

tracer = MockTracer()

while True:
    with tracer.start_span(operation_name='make_some_request') as client_span:
        tracer.scope_manager.activate(client_span, True)
        pass