Quoting my comment in CLOUDP-104364:
Using my original test case, I can confirm that libmongoc (used by PHP) is not constructing a handshake command after the fail point triggers and the connection is dropped. The relevant logic is in _begin_hello_cmd, where libmongoc only decides to recreate a handshake hello command if the node has not been used before or has experienced an error. The error-tracking is what's being missed here, and it looks like that is only set in _async_error_or_timeout, which is one of the monitoring callbacks.
This seems more like a bug in libmongoc, and is perhaps unique to their single-threaded SDAM implementation where monitoring and application sockets are one and the same. In this case, it looks like an error during application usage is not being properly recorded for the monitoring structure. We only discovered this because it causes the absence of a serviceId in the serverless hello response, but more generally this also means that libmongoc is not constructing a handshake when recreating the single monitoring/application socket for singled-threaded applications.
- is depended on by
-
PHPLIB-717 Test Serverless behind a load balancer to prevent test breakage
- Closed
-
PHPLIB-783 Update load balancer tests to support dedicated load balancer port
- Closed
- related to
-
PHPC-2071 Upgrade libbson and libmongoc to 1.20.1
- Closed
-
DRIVERS-1968 Single-threaded SDAM should construct a handshake command when reconnecting after a monitoring or application error/timeout
- Closed