Priority: Major - P3
Affects Version/s: None
Fix Version/s: 3.11
Security Level: Public
It's no longer possible to reliably connect to Atlas clusters with Jython 2.7.0. Each SDAM monitor heartbeat fails with this error:
This appears to be a bug in Jython itself and is reproducible with Jython 2.7.0 and 2.7.1 and I've reported it here: https://bugs.jython.org/issue2900.
This PyMongo regression was caused by the changes in
PYTHON-2123. Before those changes (PyMongo <3.11) this Jython bug would cause each TLS socket to be recreated each time SocketChecker.socket_closed was called. In practice this means that each SDAM connection is recreated for each heartbeat and each application socket that remains idle in the connection pool for >1 second is also closed and automatically reopened.
PYTHON-2123, we use poll() to wait for a SDAM socket to be readable. This causes each heartbeat to fail with AttributeError: 'SSLSocket' object has no attribute 'channel' and marks the server Unknown.
In summary, SSL+Jython kind of worked before but is now totally broken. If we want to fix this, we can skip the poll() logic on Jython.
Edit: I've reported the bug to Jython here: https://bugs.jython.org/issue2900