-
Notifications
You must be signed in to change notification settings - Fork 757
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
OS: Darwin Kernel Version 23.6.0
Python version: 3.12.6
SDK version: 1.27.0
API version: 1.27.0
What happened?
I've confirmed the issue with Aaron Abbott. More details can be found in the slack thread.
In a nutshell, I am unable to release the memory of otlp_exporter and reader.
Steps to Reproduce
I've prepared a code snippet that demonstrates the problem:
- Initialize
otlp_exporter,reader,providerwithweakreftrackers - Cleanup using
.shutdown(),delandgc.collect() - Assert if the
weakrefreferneces are None
Expected Result
2024-10-10 07:37:18,766 INFO [root] [reproduce.py:38] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - OTLP EXPORTER was properly garbage collected
2024-10-10 07:37:18,766 INFO [root] [reproduce.py:47] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - READER was properly garbage collected
2024-10-10 07:37:18,767 INFO [root] [reproduce.py:62] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - PROVIDER was properly garbage collected
Actual Result
2024-10-10 07:37:18,761 WARNING [opentelemetry.sdk.metrics._internal.export] [__init__.py:556] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - Can't shutdown multiple times
2024-10-10 07:37:18,766 WARNING [root] [reproduce.py:38] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - OTLP EXPORTER was not properly garbage collected
2024-10-10 07:37:18,766 DEBUG [root] [reproduce.py:40] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - Direct referrers to OTLP EXPORTER: 4
2024-10-10 07:37:18,766 DEBUG [root] [reproduce.py:42] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - OTLP EXPORTER referrer {<opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>} type: <class 'set'>
2024-10-10 07:37:18,766 DEBUG [root] [reproduce.py:42] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - OTLP EXPORTER referrer <bound method PeriodicExportingMetricReader._at_fork_reinit of <opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>> type: <class 'method'>
2024-10-10 07:37:18,766 DEBUG [root] [reproduce.py:42] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - OTLP EXPORTER referrer {<opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>: <opentelemetry.sdk.metrics._internal.metric_reader_storage.MetricReaderStorage object at 0x1063d5520>} type: <class 'dict'>
2024-10-10 07:37:18,766 DEBUG [root] [reproduce.py:42] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - OTLP EXPORTER referrer [<opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>] type: <class 'list'>
2024-10-10 07:37:18,766 WARNING [root] [reproduce.py:47] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - READER was not properly garbage collected
2024-10-10 07:37:18,767 DEBUG [root] [reproduce.py:49] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - Direct referrers to READER: 4
2024-10-10 07:37:18,767 DEBUG [root] [reproduce.py:51] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - READER referrer {<opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>} type: <class 'set'>
2024-10-10 07:37:18,767 DEBUG [root] [reproduce.py:51] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - READER referrer <bound method PeriodicExportingMetricReader._at_fork_reinit of <opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>> type: <class 'method'>
2024-10-10 07:37:18,767 DEBUG [root] [reproduce.py:51] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - READER referrer {<opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>: <opentelemetry.sdk.metrics._internal.metric_reader_storage.MetricReaderStorage object at 0x1063d5520>} type: <class 'dict'>
2024-10-10 07:37:18,767 DEBUG [root] [reproduce.py:51] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - READER referrer [<opentelemetry.sdk.metrics._internal.export.PeriodicExportingMetricReader object at 0x1063d4d10>] type: <class 'list'>
2024-10-10 07:37:18,767 INFO [root] [reproduce.py:62] [trace_id=0 span_id=0 resource.service.name= trace_sampled=False] - PROVIDER was properly garbage collected
Additional context
No response
Would you like to implement a fix?
No
patricklubach
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working