Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
3.11
-
None
-
None
Description
Pool leaves socket open when authentication fails:
test_client_handshake_saslSupportedMechs (tests.test_handshake.TestHandshake) ... /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/traceback.py:220: ResourceWarning: unclosed <socket.socket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 56287), raddr=('127.0.0.1', 56285)>
|
tb.tb_frame.clear()
|
Object allocated at (most recent call last):
|
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", lineno 890
|
self._bootstrap_inner()
|
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", lineno 932
|
self.run()
|
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py", lineno 870
|
self._target(*self._args, **self._kwargs)
|
File "/Users/shane/git/pymongo-mockup-tests/venv/python3.8/lib/python3.8/site-packages/mockupdb/__init__.py", lineno 135
|
result[0] = fn(*args, **kwargs)
|
File "/Users/shane/git/mongo-python-driver/pymongo/database.py", lineno 736
|
with self.__client._socket_for_reads(
|
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", lineno 113
|
return next(self.gen)
|
File "/Users/shane/git/mongo-python-driver/pymongo/mongo_client.py", lineno 1319
|
with self._get_socket(server, session) as sock_info:
|
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", lineno 113
|
return next(self.gen)
|
File "/Users/shane/git/mongo-python-driver/pymongo/mongo_client.py", lineno 1238
|
with server.get_socket(
|
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", lineno 113
|
return next(self.gen)
|
File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", lineno 1164
|
sock_info = self._get_socket(all_credentials)
|
File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", lineno 1211
|
sock_info = self.connect(all_credentials)
|
File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", lineno 1122
|
sock = _configured_socket(self.address, self.opts)
|
File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", lineno 929
|
sock = _create_connection(address, options)
|
File "/Users/shane/git/mongo-python-driver/pymongo/pool.py", lineno 891
|
sock = socket.socket(
|
ok
|
This was caused by PYTHON-2158.
Attachments
Issue Links
- is caused by
-
PYTHON-2158 Support speculative authentication attempts in isMaster
-
- Closed
-
- related to
-
PYTHON-2217 Add MockupDB tests for mechanism negotiation (saslSupportedMechs)
-
- Closed
-