Skip to content
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

PYTHON-4414 interruptInUseConnections should cancel pending connections too #2010

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Nov 19, 2024

PYTHON-4414 interruptInUseConnections should cancel pending connections too

Judging from the test logs, this appears to be a minor bug in the implementation of interruptInUseConnections added in PYTHON-3175. If the pool is cleared simultaneously while a thread is creating a connection, the pending connection is not cancelled or closed. Instead the connection is created normally and added to the pool as shown in the log of the failed test:

Events:
 [2024/04/29 03:44:47.090] PoolCreatedEvent(('localhost', 27017), {})
 [2024/04/29 03:44:47.090] PoolReadyEvent(('localhost', 27017))
 [2024/04/29 03:44:47.090] ConnectionCheckOutStartedEvent(('localhost', 27017))
 [2024/04/29 03:44:47.090] ConnectionCreatedEvent(('localhost', 27017), 1)
 [2024/04/29 03:44:47.090] PoolClearedEvent(('localhost', 27017), None, True)
 [2024/04/29 03:44:47.090] ConnectionReadyEvent(('localhost', 27017), 1, 10.015425856999968)
 [2024/04/29 03:44:47.090] ConnectionCheckedOutEvent(('localhost', 27017), 1, 10.018921869999986)

The fix is to ensure that pending connections are interrupted as well.

@ShaneHarvey ShaneHarvey merged commit a7c1090 into mongodb:master Nov 19, 2024
45 of 48 checks passed
@ShaneHarvey ShaneHarvey deleted the PYTHON-4414 branch November 19, 2024 19:37
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