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

Don't let certain errors fail SPI loading #41991

Conversation

alzimmermsft
Copy link
Member

Description

Modifies Providers to catch and log LinkageError and ServiceConfigurationError to prevent these errors from failing service provider loading. This is being done as it is possible for implementations of our service provider interfaces to use designs that aren't generally compatible with our support matrix, an example of this is our own JDK HttpClient implementation of the HttpClient service provider which only supports Java 11+ but we base line our Java support on Java 8. It's possible for this to be on the classpath even if the JVM running an application using our SDKs only supports Java 8, and this would cause the application to error out even is another HttpClient implementation, such as our Netty implementation, is also available on the classpath and is valid.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@alzimmermsft alzimmermsft merged commit 991ca62 into Azure:main Sep 23, 2024
34 checks passed
@alzimmermsft alzimmermsft deleted the AzCore_DontLetLinkageErrorsLeakFromSpiLoading branch September 23, 2024 21:36
@anuchandy anuchandy mentioned this pull request Oct 18, 2024
6 tasks
mssfang pushed a commit to mssfang/azure-sdk-for-java that referenced this pull request Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core azure-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants