Skip to content

Fix async resource functions not being awaited #1092

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

Merged
merged 20 commits into from
Jul 6, 2025
Merged

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented Jul 4, 2025

When using @server.resource decorator with an async function, the function would return a coroutine object that was never awaited. This led to:

  • Resource functions not executing their logic
  • Tests hanging when resources were used in concurrent scenarios with tools
  • Runtime warnings about unawaited coroutines

Noticed while refactoring tests/issues/test_188_concurrency.py test. It was hanging with resources and working perfectly fine with tools. (annoyingly only lowest version test were affected - great that we have them now! )

@ihrpr ihrpr marked this pull request as ready for review July 4, 2025 17:34
Base automatically changed from add-lowest-dependency-test to main July 6, 2025 07:38
Kludex
Kludex previously approved these changes Jul 6, 2025
@Kludex Kludex enabled auto-merge (squash) July 6, 2025 07:41
@ihrpr ihrpr disabled auto-merge July 6, 2025 09:22
@ihrpr ihrpr merged commit 3d67e72 into main Jul 6, 2025
30 of 33 checks passed
@ihrpr ihrpr deleted the ihrpr/fix-resource branch July 6, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants