We have a docker based architecture for the product , And I do the below when I bring up all the docker containers
conn := mongo.connect()
sess, _ := conn.StartSession()
So at this point in time I have the *mongo.client
& mongo.Session
I know *mongo.client
is go routine safe and we use that for susbsequent operations , Also we do connect only once when we try to bring the docker instance .
So my question is when we bring down all the containers ? Do I need a teardown mechanism to say disconnect the client and mongo.session
? If I don’t do that what will be the problem . And if I can get a recommended way of how to close the session and client that would be helpful .