Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header only singletons are not working properly for Windows #2534

Open
marcalff opened this issue Feb 14, 2024 · 2 comments
Open

Header only singletons are not working properly for Windows #2534

marcalff opened this issue Feb 14, 2024 · 2 comments
Labels
bug Something isn't working Stale triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@marcalff
Copy link
Member

marcalff commented Feb 14, 2024

The opentelemetry-cpp API uses header only singletons, for example for the tracer provider.

When:

  • an application calls TracerProvider::SetTracerProvider() in the main application code
  • a shared library is loaded by the main application
  • the shared library uses TracerProvider::GetTracerProvider()

the shared library does not see the tracer provider installed in the main application.

As a result, opentelemetry is disabled in the shared library (the noop tracer provider is seen instead).

Related issues:

The issue about singletons for the Windows platform is known, but still not resolved.

@marcalff marcalff added the bug Something isn't working label Feb 14, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 14, 2024
@ThomsonTan ThomsonTan added triage/accepted Indicates an issue or PR is ready to be actively worked on. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 21, 2024
@marcalff marcalff removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 22, 2024
@malkia
Copy link

malkia commented Feb 22, 2024

I've been running the singleton_test in my soft-fork that targets single .dll for Windows (combining sdk+api) - and it's passing in that version. - https:/malkia/opentelemetry-cpp/actions/runs/7878684091/job/21497437677#step:5:8420 - this has been my "test" to ensure that I'm not breaking things across dlls - but I've been relyin on bazel to make the .dll, not CMake (it's what I'm more familiar with).

Copy link

This issue was marked as stale due to lack of activity.

@github-actions github-actions bot added the Stale label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants