Skip to content

Conversation

aclark4life
Copy link
Contributor

@aclark4life aclark4life commented Sep 11, 2025

  • Import/use BaseProtocol instead of Protocol in PyMongoBaseProtocol implementation added in PYTHON-5215.
  • Resolves issue with instance type check in uvloop that prevents correct buffered config from being set.

- Import and use BaseProtocol instead of Protocal in
  PyMongoBaseProtocoal implementation. Resolves issue with instance type
  check in uvloop that prevents correct buffered config from being set.
@aclark4life aclark4life requested a review from a team as a code owner September 11, 2025 17:42
Copy link
Contributor

@NoahStapp NoahStapp left a comment

Choose a reason for hiding this comment

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

Can you change the title of the PR to reflect the change better? Something like "PyMongoBaseProtocol should inherit from asyncio.BaseProtocol".

Version 4.15.1 is a bug fix release.

- Fixed a bug in ``MongoClient.network_layer`` and ``AsyncMongoClient.network_layer``
that could cause an ``TimeoutError`` when connecting to servers.
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to call out that the bug was in network_layer. We do need to call out that it was a bug with AsyncMongoClient, and only with uvicorn and uvloop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK I'll fix, what about the difference between PYTHON-5543 and PYTHON-5544? I couldn't reproduce for PYTHON-5543 because the reproducer was incomplete. Should we assume some use of uvicorn with FastAPI?

Copy link
Member

Choose a reason for hiding this comment

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

I closed PYTHON-5543 as a duplicate. Let me know if that's incorrect.

Copy link
Contributor

Choose a reason for hiding this comment

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

uvicorn defaults to uvloop under the hood.

@ShaneHarvey
Copy link
Member

drivers-pr-bot please backport to v4.15

@aclark4life aclark4life changed the title PYTHON-5543 Fix asyncio import PYTHON-5543 PyMongoBaseProtocol should inherit from asyncio.BaseProtocol Sep 11, 2025
Co-authored-by: Noah Stapp <noah@noahstapp.com>
@aclark4life aclark4life merged commit 3da6e85 into mongodb:master Sep 11, 2025
66 of 68 checks passed
@aclark4life aclark4life deleted the PYTHON-5543 branch September 11, 2025 20:37
aclark4life added a commit to aclark4life/mongo-python-driver that referenced this pull request Sep 11, 2025
…col (mongodb#2528)

Co-authored-by: Noah Stapp <noah@noahstapp.com>
aclark4life added a commit to aclark4life/mongo-python-driver that referenced this pull request Sep 11, 2025
…col (mongodb#2528)

Co-authored-by: Noah Stapp <noah@noahstapp.com>
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