Skip to content

Close leaky resources in azure-resources#2876

Merged
jack-berg merged 2 commits into
open-telemetry:mainfrom
jack-berg:azure-okhttp-singleton
May 28, 2026
Merged

Close leaky resources in azure-resources#2876
jack-berg merged 2 commits into
open-telemetry:mainfrom
jack-berg:azure-okhttp-singleton

Conversation

@jack-berg

Copy link
Copy Markdown
Member

No description provided.

@jack-berg
jack-berg marked this pull request as ready for review May 27, 2026 19:34
@jack-berg
jack-berg requested a review from a team as a code owner May 27, 2026 19:34
Copilot AI review requested due to automatic review settings May 27, 2026 19:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses resource-leak risks in two contrib components by ensuring streams/clients are properly closed after use.

Changes:

  • jfr-connection: read JFC configuration with try-with-resources and add error wrapping when reading fails.
  • azure-resources: ensure OkHttp resources (dispatcher executor + connection pool) are shut down/evicted after each metadata fetch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/JfcFileConfiguration.java Uses try-with-resources for configuration reading and adds exception wrapping.
azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureMetadataService.java Explicitly shuts down OkHttp client internals to prevent thread/connection leaks.

@jack-berg jack-berg changed the title Close leaky resources in azure-resources, jfr-connection Close leaky resources in azure-resources May 27, 2026
@jack-berg
jack-berg added this pull request to the merge queue May 28, 2026
Merged via the queue into open-telemetry:main with commit 6cb5168 May 28, 2026
22 checks passed
@jack-berg
jack-berg deleted the azure-okhttp-singleton branch May 28, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants