Skip to content

[BUG] Systemic Robustness Issues in Azure AI SDK Samples: Infinite Polling, Async Blocking, and Missing Error Handling #47379

@Granger123f-h2

Description

@Granger123f-h2
  • Package Name: azure-ai-projects ,
    azure-ai-agents
  • Package Version: latest (main branch)
  • Operating System:All
  • Python Version:3.10+

Describe the bug
A manual audit of the sample scripts has revealed systemic robustness issues including infinite polling loops, blocking synchronous sleep in asynchronous samples, and missing error handling for failed run statuses. These patterns could lead to client-side DoS or frozen event loops if adopted by developers.

To Reproduce

  1. Infinite polling in 'sample_evaluations_builtin_with_traces.py' (L241-L248).
  2. Blocking 'time.sleep()' in 'sample_agents_functions_async.py' (L81-L83).
  3. Missing status checks before processing outputs in 'sample_evaluations_builtin_with_csv.py'.`
    Expected behavior
  4. Polling loops should have a maximum timeout or retry limit. 2. Asynchronous samples must use 'await asyncio.sleep()' instead of 'time.sleep()'. 3. Scripts should explicitly verify that a run status is 'completed' before attempting to retrieve results.
    Screenshots

Additional context
I am a bug hunter and would be happy to submit a Pull Request to fix these issues in the samples if the maintainers agree with these findings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions