[SERVER-39390] --eval 'db.shutdownServer()' on 4.0 show warnings not present in previous versions Created: 06/Feb/19  Updated: 08/Jan/24  Resolved: 15/Mar/19

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Miguel Angel Nieto Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Sprint: Service Arch 2019-02-25
Participants:
Case:

 Description   

Hello,

The output of the command mongo --eval 'db.shutdownServer()' admin has changed in the latest 4.0 version.

3.4:

> mongo --eval 'db.shutdownServer()' admin
MongoDB shell version v3.4.17
connecting to: mongodb://127.0.0.1:27017/admin
MongoDB server version: 3.4.17
server should be down...

3.6:

> mongo --eval 'db.shutdownServer()' admin
MongoDB shell version v3.6.8
connecting to: mongodb://127.0.0.1:27017/admin
MongoDB server version: 3.6.8
server should be down...

4.0:

> mongo --eval 'db.shutdownServer()' admin
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:27017/admin?authSource=admin&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("676a6332-127a-4caa-85a8-51ea5fd88069") }
MongoDB server version: 4.0.5
server should be down...
2019-02-06T12:54:59.356+0000 I NETWORK  [js] trying reconnect to 127.0.0.1:27017 failed
2019-02-06T12:54:59.356+0000 I NETWORK  [js] reconnect 127.0.0.1:27017 failed failed 
2019-02-06T12:54:59.356+0000 I QUERY    [js] Failed to end session { id: UUID("676a6332-127a-4caa-85a8-51ea5fd88069") } due to SocketException: socket exception [CONNECT_ERROR] server [couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused]

This is confusing, because there are three error messages and the "server should be down" is there in the middle.

Those warning messages shouldn't be there to make the message clear and not confuse the users.



 Comments   
Comment by Kaloian Manassiev [ 15/Mar/19 ]

The message is telling you that there are some sessions opened by the shell, which could not be closed, because the server is shut down.

Given that this happens on server shut down and that the alternative is to entirely mask warnings for inability to close sessions (which sometimes is useful since it indicates the shell possibly left an orphaned session), I am closing this as Works as Designed.

Generated at Thu Feb 08 04:51:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.