summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands/server_status_servers.cpp4
-rw-r--r--src/mongo/db/mongod_main.cpp23
-rw-r--r--src/mongo/db/service_context.cpp8
-rw-r--r--src/mongo/db/service_context.h13
4 files changed, 4 insertions, 44 deletions
diff --git a/src/mongo/db/commands/server_status_servers.cpp b/src/mongo/db/commands/server_status_servers.cpp
index 85a57202370..cc39b6da7d8 100644
--- a/src/mongo/db/commands/server_status_servers.cpp
+++ b/src/mongo/db/commands/server_status_servers.cpp
@@ -33,6 +33,7 @@
#include "mongo/db/commands/server_status.h"
#include "mongo/transport/message_compressor_registry.h"
#include "mongo/transport/service_entry_point.h"
+#include "mongo/transport/service_executor_synchronous.h"
#include "mongo/util/net/hostname_canonicalization.h"
#include "mongo/util/net/socket_utils.h"
#include "mongo/util/net/ssl_manager.h"
@@ -77,12 +78,13 @@ public:
return true;
}
+ // TODO: need to track connections in server stats (see SERVER-49073)
BSONObj generateSection(OperationContext* opCtx,
const BSONElement& configElement) const override {
BSONObjBuilder b;
networkCounter.append(b);
appendMessageCompressionStats(&b);
- auto executor = opCtx->getServiceContext()->getServiceExecutor();
+ auto executor = transport::ServiceExecutorSynchronous::get(opCtx->getServiceContext());
if (executor) {
BSONObjBuilder section(b.subobjStart("serviceExecutorTaskStats"));
executor->appendStats(&section);
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp
index 368c7605491..553ef9843bd 100644
--- a/src/mongo/db/mongod_main.cpp
+++ b/src/mongo/db/mongod_main.cpp
@@ -734,16 +734,7 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
// operation context anymore
startupOpCtx.reset();
- auto start = serviceContext->getServiceExecutor()->start();
- if (!start.isOK()) {
- LOGV2_ERROR(20570,
- "Error starting service executor: {error}",
- "Error starting service executor",
- "error"_attr = start);
- return EXIT_NET_ERROR;
- }
-
- start = serviceContext->getServiceEntryPoint()->start();
+ auto start = serviceContext->getServiceEntryPoint()->start();
if (!start.isOK()) {
LOGV2_ERROR(20571,
"Error starting service entry point: {error}",
@@ -1279,18 +1270,6 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
"Service entry point did not shutdown within the time limit");
}
}
-
- // Shutdown and wait for the service executor to exit
- if (auto svcExec = serviceContext->getServiceExecutor()) {
- LOGV2_OPTIONS(4784924, {LogComponent::kExecutor}, "Shutting down the service executor");
- Status status = svcExec->shutdown(Seconds(10));
- if (!status.isOK()) {
- LOGV2_OPTIONS(20564,
- {LogComponent::kNetwork},
- "Service executor did not shutdown within the time limit",
- "error"_attr = status);
- }
- }
#endif
LOGV2(4784925, "Shutting down free monitoring");
diff --git a/src/mongo/db/service_context.cpp b/src/mongo/db/service_context.cpp
index 9d9f907aa1b..e94e71b2629 100644
--- a/src/mongo/db/service_context.cpp
+++ b/src/mongo/db/service_context.cpp
@@ -199,10 +199,6 @@ ServiceEntryPoint* ServiceContext::getServiceEntryPoint() const {
return _serviceEntryPoint.get();
}
-transport::ServiceExecutor* ServiceContext::getServiceExecutor() const {
- return _serviceExecutor.get();
-}
-
void ServiceContext::setStorageEngine(std::unique_ptr<StorageEngine> engine) {
invariant(engine);
invariant(!_storageEngine);
@@ -233,10 +229,6 @@ void ServiceContext::setTransportLayer(std::unique_ptr<transport::TransportLayer
_transportLayer = std::move(tl);
}
-void ServiceContext::setServiceExecutor(std::unique_ptr<transport::ServiceExecutor> exec) {
- _serviceExecutor = std::move(exec);
-}
-
void ServiceContext::ClientDeleter::operator()(Client* client) const {
ServiceContext* const service = client->getServiceContext();
{
diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h
index 49cb7a602ba..5ad7c9c0e79 100644
--- a/src/mongo/db/service_context.h
+++ b/src/mongo/db/service_context.h
@@ -488,14 +488,6 @@ public:
ServiceEntryPoint* getServiceEntryPoint() const;
/**
- * Get the service executor for the service context.
- *
- * See ServiceStateMachine for how this is used. Some configurations may not have a service
- * executor registered and this will return a nullptr.
- */
- transport::ServiceExecutor* getServiceExecutor() const;
-
- /**
* Waits for the ServiceContext to be fully initialized and for all TransportLayers to have been
* added/started.
*
@@ -580,11 +572,6 @@ public:
void setTransportLayer(std::unique_ptr<transport::TransportLayer> tl);
/**
- * Binds the service executor to the service context
- */
- void setServiceExecutor(std::unique_ptr<transport::ServiceExecutor> exec);
-
- /**
* Creates a delayed execution baton with basic functionality
*/
BatonHandle makeBaton(OperationContext* opCtx) const;