Differences in Shutdown Output Between mongo Shell and mongosh Shell

Hi MongoDB community,

I am encountering differing outputs when trying to shut down my MongoDB server using the mongo shell and the mongosh shell, and I want to understand why this is happening.
I executed the following commands in their respective shells:
Using mongo shell:
mongo --port 45768 --username **** --password ***** --authenticationDatabase admin --eval "db.getSiblingDB('admin').shutdownServer()"
output:

MongoDB shell version v5.0.22
connecting to: mongodb://127.0.0.1:45768/?authSource=admin&compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("3f613e46-c850-4ac6-ba12-51267ef98e9d") }
MongoDB server version: 5.0.22
server should be down...
{"t":{"$date":"2024-12-03T09:02:41.898Z"},"s":"I",  "c":"QUERY",    "id":22791,   "ctx":"js","msg":"Failed to end logical session","attr":{"lsid":{"id":{"$uuid":"3f613e46-c850-4ac6-ba12-51267ef98e9d"}},"error":{"code":9001,"codeName":"SocketException","errmsg":"socket exception [CONNECT_ERROR] server [couldn't connect to server 127.0.0.1:45768, connection attempt failed: SocketException: Error connecting to 127.0.0.1:45768 :: caused by :: No connection could be made because the target machine actively refused it.]"}}}
Using mongosh shell:
mongosh --port 64352 --username  **** --password  **** --authenticationDatabase admin --eval "db.getSiblingDB('admin').shutdownServer()"

output:
Error: read ECONNRESET

  • MongoDB version: 5.0.22
  • mongo shell version: v5.0.22
  • mongosh version: v6.x