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

remove global configuration resolver #1118

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Conversation

brettmc
Copy link
Collaborator

@brettmc brettmc commented Sep 27, 2023

Exposing it through Globals can cause a race condition. If something (eg, a contrib module) retrieves the configuration resolver from Globals too early during autoloading, then it causes the rest of the objects from Globals to be initialized. This can happen before all required modules have been registered (depending on autoload->files execution order, which is variable). Instead, create a simple API config resolver which does the basics of what the SDK one does (without all the type checking and validation).

Exposing it through Globals can cause a race condition. If something (eg, a contrib module)
retrieves the configuration resolver from Globals too early during autoloading, then it
causes the rest of the objects from Globals to be initialized. This can happen before all
required modules have been registered (depending on autoload->files execution order, which
is variable). Instead, create a simple API config resolver which does the basics of what the
SDK one does (without all the type checking and validation).
@brettmc brettmc requested a review from a team September 27, 2023 03:37
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #1118 (1983114) into main (197a7a4) will increase coverage by 0.45%.
Report is 3 commits behind head on main.
The diff coverage is 72.32%.

❗ Current head 1983114 differs from pull request most recent head ed2991d. Consider uploading reports for the commit ed2991d to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1118      +/-   ##
============================================
+ Coverage     83.05%   83.50%   +0.45%     
- Complexity     2151     2160       +9     
============================================
  Files           278      279       +1     
  Lines          6119     6136      +17     
============================================
+ Hits           5082     5124      +42     
+ Misses         1037     1012      -25     
Flag Coverage Δ
7.4 82.12% <72.32%> (+0.45%) ⬆️
8.0 83.43% <72.32%> (+0.45%) ⬆️
8.1 83.57% <72.32%> (+0.45%) ⬆️
8.2 83.57% <72.32%> (+0.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/API/Behavior/Internal/LogWriter/Formatter.php 100.00% <100.00%> (ø)
src/API/Behavior/LogsMessagesTrait.php 100.00% <100.00%> (ø)
src/API/Globals.php 94.28% <100.00%> (-0.59%) ⬇️
src/API/Instrumentation/Configurator.php 100.00% <ø> (ø)
src/API/Instrumentation/ContextKeys.php 100.00% <ø> (ø)
src/Contrib/Otlp/OtlpHttpTransportFactory.php 75.00% <ø> (ø)
...ommon/Adapter/HttpDiscovery/DependencyResolver.php 100.00% <ø> (+8.33%) ⬆️
src/SDK/Common/Export/Http/PsrTransportFactory.php 78.26% <100.00%> (ø)
src/SDK/Common/Export/Http/PsrUtils.php 92.42% <100.00%> (+1.04%) ⬆️
src/SDK/SdkAutoloader.php 93.75% <ø> (-0.19%) ⬇️
... and 7 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73ff5ad...ed2991d. Read the comment docs.

@brettmc brettmc merged commit 8809c2a into open-telemetry:main Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants