[fix] infinite eval results when outbound limited#46865
Open
Zyysurely wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a hang/“infinite” evaluation result scenario by ensuring the OpenTelemetry LoggerProvider used to emit evaluation results to Application Insights is always shut down, preventing background threads from keeping the process alive when outbound connectivity is limited.
Changes:
- Add a
finallyblock to always calllogger_provider.shutdown()inemit_eval_result_events_to_app_insights. - Add unit tests validating
shutdown()is called on success, exception, and flush-timeout paths (and not called when results are empty).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_evaluate.py | Ensures the OpenTelemetry logger provider is shut down to prevent lingering background threads. |
| sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py | Adds tests asserting LoggerProvider.shutdown() is invoked across success/failure/timeout paths. |
posaninagendra
approved these changes
May 13, 2026
posaninagendra
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The exporter starts a background OneSettings configuration poller thread that retries every 2 hours. When the SSL connection to settings.sdk.monitor.azure.com fails (as in your logs), this thread keeps retrying indefinitely, keeping the process alive.
When outbound network is limited, it would be stuck.
{"TimeStamp": "2026-05-08T13:46:36.156436+00:00", "Log": "F WARNING:azure.monitor.opentelemetry.exporter._configuration._utils:Failed to fetch configuration from OneSettings: HTTPSConnectionPool(host='settings.sdk.monitor.azure.com', port=443): Max retries exceeded with url: /AzMonSDKDynamicConfigurationChanges?namespaces=python (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1017)')))"}All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines