[SERVER-12377] mongos loads config db before listening on its port Created: 16/Jan/14  Updated: 10/Dec/14  Resolved: 16/Jan/14

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

Type: Improvement Priority: Major - P3
Reporter: Kevin Pulo Assignee: Unassigned
Resolution: Done Votes: 0
Labels: mongos
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

If the listening port cannot be setup (eg. can't bind because already in use by another mongos, nofile ulimits exceeded, etc), mongos will exit. However, a lot of other state has been setup prior to this, including loading the config db from the config server. In the case where bind() is going to fail, this just adds needless load to the config/shard servers. It would be better if the listening port could first be created and bound to, then the config db loaded and other setup performed, before finally calling accept() on the listening port.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 16/Jan/14 ]

It is done this way because then there isn't a very long delay for the first client. Once a client can open a socket, all operations should be fast.

Generated at Thu Feb 08 03:28:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.