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

Break circular dependency when zipkin tracing is enabled #1049

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

jeremyg484
Copy link
Contributor

@jeremyg484 jeremyg484 commented Feb 15, 2024

Creating the default http client in the constructor of DefaultOAuth2HttpTransportFactory was causing a circular dependency when Zipkin tracing is enabled. There were no tests for StackDriverSenderFactory in the gcp-tracing module, thus the bug was undiscovered until users tried out the new release and reported the issue.

DefaultOAuth2HttpTransportFactory is updated to lazily create the default http client via a memoized Supplier, in the same manner as we do in the Micronaut Security JWKS client, and this breaks the dependency cycle.

A simple StackdriverConfigurationSpec is added to reproduce the issue and verify the fix.

This resolves #1045

@jeremyg484 jeremyg484 self-assigned this Feb 15, 2024
@jeremyg484 jeremyg484 requested review from timyates and sdelamo and removed request for timyates February 15, 2024 20:10
Copy link

@sdelamo sdelamo added the type: bug Something isn't working label Feb 16, 2024
@sdelamo sdelamo merged commit 0470d3d into master Feb 16, 2024
11 checks passed
@sdelamo sdelamo deleted the stackdriver-oauth-fix branch February 16, 2024 09:18
sdelamo added a commit that referenced this pull request Feb 16, 2024
* Break circular dependency when zipkin tracing is enabled

* Update gcp-tracing/src/test/resources/logback.xml

* Update gcp-tracing/src/test/groovy/io/micronaut/gcp/tracing/zipkin/StackdriverConfigurationSpec.groovy

---------

Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com>
Copy link
Contributor

@timyates timyates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Micronaut 4.3.0+ and Micronaut GCP 5.4.0 Causes Stackoverflow on Startup
3 participants