Skip to content

[fix] infinite eval results when outbound limited#46865

Open
Zyysurely wants to merge 2 commits into
mainfrom
zyying/fix_infinite_emission
Open

[fix] infinite eval results when outbound limited#46865
Zyysurely wants to merge 2 commits into
mainfrom
zyying/fix_infinite_emission

Conversation

@Zyysurely
Copy link
Copy Markdown
Contributor

@Zyysurely Zyysurely commented May 13, 2026

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:

  • 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.

Copilot AI review requested due to automatic review settings May 13, 2026 18:24
@Zyysurely Zyysurely requested a review from a team as a code owner May 13, 2026 18:24
@github-actions github-actions Bot added the Evaluation Issues related to the client library for Azure AI Evaluation label May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 finally block to always call logger_provider.shutdown() in emit_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.

Comment thread sdk/evaluation/azure-ai-evaluation/tests/unittests/test_evaluate.py
@Zyysurely Zyysurely enabled auto-merge (squash) May 13, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Evaluation Issues related to the client library for Azure AI Evaluation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants