diff options
author | Jason Carey <jcarey@argv.me> | 2016-08-11 16:03:40 -0400 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2016-08-23 14:13:17 -0400 |
commit | 07020e0b0cadf1639824f985a3ae6ce09d4c5ee8 (patch) | |
tree | b89e60d25521905f312bc34aefbdf3a6a637c251 /src/mongo/s | |
parent | c38c8a9ef540b337cce414f8db4a7b93890926b7 (diff) | |
download | mongo-07020e0b0cadf1639824f985a3ae6ce09d4c5ee8.tar.gz |
SERVER-25572 Fix ASAN clean shutdown logic
During shutdown a number of things are currently happening that shouldn't be:
1. The legacy transport layer is failing to actually close sockets in closeAll. It's doing this
because the default argument to closeAll is to leave all sockets open on the legacy transport layer
(versus to close them on the actual interface header).
2. The thing we're checking for in shutdown is wrong. It's just that we've left recv in all db
workers, rather than that we've left all client workers (so ASAN is occasionally unhappy about
"leaks")
3. Tests rely on external callers to close sockets. when this contract changes, we take an extra 10
seconds to shut down every mongod, making some tests time out.
Fix this by adding a counter for actual live workers, so we can track when it's safe to shutdown
correctly. Also fix the typo
Diffstat (limited to 'src/mongo/s')
-rw-r--r-- | src/mongo/s/server.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp index 613800a8547..52c0f22e5a9 100644 --- a/src/mongo/s/server.cpp +++ b/src/mongo/s/server.cpp @@ -231,9 +231,12 @@ static ExitCode runMongosServer() { opts.ipList = serverGlobalParams.bind_ip; auto sep = - std::make_shared<ServiceEntryPointMongos>(getGlobalServiceContext()->getTransportLayer()); + stdx::make_unique<ServiceEntryPointMongos>(getGlobalServiceContext()->getTransportLayer()); + auto sepPtr = sep.get(); - auto transportLayer = stdx::make_unique<transport::TransportLayerLegacy>(opts, sep); + getGlobalServiceContext()->setServiceEntryPoint(std::move(sep)); + + auto transportLayer = stdx::make_unique<transport::TransportLayerLegacy>(opts, sepPtr); auto res = transportLayer->setup(); if (!res.isOK()) { return EXIT_NET_ERROR; |