Hi @Rapha_Ben, I opened https://jira.mongodb.org/browse/PYTHON-4699 to investigate, but it looks like the behavior on Google Cloud Run Functions is not what we expected. PyMongo itself is not fork-safe, and it looks like the pattern recommended in the docs might be resulting in a fork operation. For now I would recommend recreating the MongoClient upon API call.

1 Like