Testing latest server release, we are hitting an unexpected invariant:
ClientMetadata was previously set, it should be set precisely once","file":"src/mongo/rpc/metadata/client_metadata.cpp","line":545"
It's happening due to a combination of factors:
- We are testing against a server with requireApiVersion parameter set to true, which causes the isMaster handshake command to fail.
- For unrelated reasons, we are using a version of PyMongo with a bug that exposes the invariant (
PYTHON-1434) by retrying the ismaster on the same connection. It will be difficult to upgrade PyMongo in the short term.
What we expect to happen is that the server uasserts and perhaps closes the connection. What actually happens is that we hit the invariant and the server shuts down.
This behavior seems to have been introduced relatively recently, in scope of
SERVER-49336. I discussed it briefly with the author of that commit, and it doesn't appear that this behavior is intended. Instead, we should first be hitting this uassert, but it seems that we are not.
Server logs are available here.
- is duplicated by
SERVER-56935 "ClientMetadata was previously set" invariant in embedded SDK
- is related to
PYTHON-2470 Investigate if mongo-orchestration can upgrade from pymongo 3.5 to 3.11
SERVER-53400 Write tests for verifying client metadata
- related to
SERVER-49336 Set client metadata if it is missing during failCommand