Skip to content

Conversation

stepansergeevitch
Copy link
Collaborator

Fixed anyio race condition, which happened when it was lazily importing async backend modules. Now we always import all available backends on the module-level, so this issues doesn't occur anymore. Added integration test

@stepansergeevitch stepansergeevitch self-assigned this Jun 21, 2022
@stepansergeevitch stepansergeevitch changed the title Fir 14026 frequently get attributeerror fix: Fir 14026 frequently get attributeerror Jun 21, 2022
Copy link
Contributor

@ptiurin ptiurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine as a hack, but I'm worried the functionality might break later on.

Comment on lines +26 to +31
for backend in ("asyncio", "trio"):
try:
get_asynclib(backend)
except ModuleNotFoundError:
# Not all backends might be installed
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just worried since we're using a "private" API for this hack it might change without notice. As we're pinning the httpx version we're fine for now, but if we were to upgrade it might cause issues. Hopefully it will be picked up by nightly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will investigate how this could be properly fixed

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@yuryfirebolt yuryfirebolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stepansergeevitch stepansergeevitch merged commit 80c95d2 into main Jun 22, 2022
@stepansergeevitch stepansergeevitch deleted the FIR-14026-frequently-get-attributeerror- branch June 22, 2022 13:09
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.

3 participants