-
Notifications
You must be signed in to change notification settings - Fork 500
Open
Labels
bugSomething isn't workingSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
Context
In an instrumented application, the opentelemetry-cpp library static library is linked inside a bigger shared library, loaded and unloaded dynamically.
On cleanup, the code:
- calls shutdown on every signal provider
- releases the last references to every signal provider
- unload the shared library
Problem
The OTLP HTTP exporter background threads are detached, and may still run by the time the shared library is unloaded.
This causes the code of the opentelemetry-cpp library itself to be un mapped from the process space, while a thread is still running, leading to a crash.
Expected behavior
Never detach a thread.
Instead, properly join background threads to make sure the cleanup is complete, before returning from Shutdown.
This affects the OTLP HTTP exporter, as well as the OTLP FILE exporter.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.