summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@yahooinc.com>2023-02-22 12:54:31 +0000
committerHåvard Pettersen <havardpe@yahooinc.com>2023-02-22 14:46:14 +0000
commitb6073079e7d0d09fb7f13606d3fe3f1798337d66 (patch)
tree70998a611bdb7af626e8f480e34062db7783c2ea /searchcore
parent890e0ac9e795ca1c95e459f98a54593ac151051c (diff)
untangle fnet from fastos
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/apps/proton/proton.cpp6
-rw-r--r--searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp4
-rw-r--r--searchcore/src/tests/proton/common/timer/timer_test.cpp6
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/transport_helper.h4
7 files changed, 15 insertions, 21 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp
index 2c47b5162ca..4d21143935b 100644
--- a/searchcore/src/apps/proton/proton.cpp
+++ b/searchcore/src/apps/proton/proton.cpp
@@ -206,10 +206,10 @@ buildTransportConfig() {
class Transport {
public:
- Transport(const fnet::TransportConfig & config, FastOS_ThreadPool & threadPool)
+ Transport(const fnet::TransportConfig & config)
: _transport(config)
{
- _transport.Start(&threadPool);
+ _transport.Start();
}
~Transport() {
_transport.ShutDown(true);
@@ -284,7 +284,7 @@ App::main(int argc, char **argv)
setupSignals();
setup_fadvise();
FastOS_ThreadPool threadPool;
- Transport transport(buildTransportConfig(), threadPool);
+ Transport transport(buildTransportConfig());
startAndRun(threadPool, transport.transport(), argc, argv);
} catch (const vespalib::InvalidCommandLineArgumentsException &e) {
LOG(warning, "Invalid commandline arguments: '%s'", e.what());
diff --git a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
index 76fc875b209..d69c978729d 100644
--- a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
+++ b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
@@ -379,7 +379,6 @@ class BaseUtility : public Utility
protected:
const BaseOptions &_bopts;
DummyFileHeaderContext _fileHeader;
- FastOS_ThreadPool _threadPool;
FNET_Transport _transport;
TransLogServer _server;
client::TransLogClient _client;
@@ -388,12 +387,11 @@ public:
BaseUtility(const BaseOptions &bopts)
: _bopts(bopts),
_fileHeader(),
- _threadPool(),
_transport(),
_server(_transport, _bopts.tlsName, _bopts.listenPort, _bopts.tlsDir, _fileHeader),
_client(_transport, vespalib::make_string("tcp/localhost:%d", _bopts.listenPort))
{
- _transport.Start(&_threadPool);
+ _transport.Start();
}
~BaseUtility() override {
_transport.ShutDown(true);
diff --git a/searchcore/src/tests/proton/common/timer/timer_test.cpp b/searchcore/src/tests/proton/common/timer/timer_test.cpp
index ac82767cd7c..e3df6b319a9 100644
--- a/searchcore/src/tests/proton/common/timer/timer_test.cpp
+++ b/searchcore/src/tests/proton/common/timer/timer_test.cpp
@@ -46,17 +46,15 @@ make_scheduled_executor<ScheduledForwardExecutor>(FNET_Transport& transport, ves
template <typename ScheduledT>
class ScheduledExecutorTest : public testing::Test {
public:
- FastOS_ThreadPool threadPool;
FNET_Transport transport;
vespalib::ThreadStackExecutor executor;
std::unique_ptr<ScheduledT> timer;
ScheduledExecutorTest()
- : threadPool(),
- transport(),
+ : transport(),
executor(1)
{
- transport.Start(&threadPool);
+ transport.Start();
timer = make_scheduled_executor<ScheduledT>(transport, executor);
}
~ScheduledExecutorTest() {
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
index afd224c55de..4b6ffd07b8a 100644
--- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
+++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
@@ -305,7 +305,8 @@ TEST_FFF("require that proton config fetcher follows changes to bootstrap",
ConfigTestFixture("search"),
ProtonConfigOwner(),
ProtonConfigFetcher(f1.transport.transport(), ConfigUri(f1.configId, f1.context), f2, 60s)) {
- f3.start(f1.transport.threadPool());
+ FastOS_ThreadPool pool;
+ f3.start(pool);
ASSERT_TRUE(f2._configured);
ASSERT_TRUE(f1.configEqual(f2.getBootstrapConfig()));
f2._configured = false;
@@ -320,7 +321,8 @@ TEST_FFF("require that proton config fetcher follows changes to doctypes",
ConfigTestFixture("search"),
ProtonConfigOwner(),
ProtonConfigFetcher(f1.transport.transport(), ConfigUri(f1.configId, f1.context), f2, 60s)) {
- f3.start(f1.transport.threadPool());
+ FastOS_ThreadPool pool;
+ f3.start(pool);
f2._configured = false;
f1.addDocType("typea");
@@ -340,7 +342,8 @@ TEST_FFF("require that proton config fetcher reconfigures dbowners",
ConfigTestFixture("search"),
ProtonConfigOwner(),
ProtonConfigFetcher(f1.transport.transport(), ConfigUri(f1.configId, f1.context), f2, 60s)) {
- f3.start(f1.transport.threadPool());
+ FastOS_ThreadPool pool;
+ f3.start(pool);
ASSERT_FALSE(f2.getDocumentDBConfig("typea"));
// Add db and verify that config for db is provided
diff --git a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp
index 587da244937..8ab71637684 100644
--- a/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/rpc_hooks.cpp
@@ -136,7 +136,7 @@ RPCHooksBase::open(Params & params)
initRPC();
_regAPI.registerName((params.identity + "/realtimecontroller").c_str());
_orb->Listen(params.rtcPort);
- _transport->Start(&_proton.getThreadPool());
+ _transport->Start();
LOG(debug, "started monitoring interface");
}
diff --git a/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp b/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp
index d0bc4dfd4d8..454a7093087 100644
--- a/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp
+++ b/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp
@@ -12,11 +12,10 @@
namespace proton {
Transport::Transport()
- : _threadPool(std::make_unique<FastOS_ThreadPool>()),
- _transport(std::make_unique<FNET_Transport>()),
+ : _transport(std::make_unique<FNET_Transport>()),
_clock(std::make_unique<vespalib::TestClock>())
{
- _transport->Start(_threadPool.get());
+ _transport->Start();
}
Transport::~Transport() {
diff --git a/searchcore/src/vespa/searchcore/proton/test/transport_helper.h b/searchcore/src/vespa/searchcore/proton/test/transport_helper.h
index 46ca8131041..8a724009fc1 100644
--- a/searchcore/src/vespa/searchcore/proton/test/transport_helper.h
+++ b/searchcore/src/vespa/searchcore/proton/test/transport_helper.h
@@ -3,8 +3,6 @@
#include <vespa/searchcorespi/index/ithreadingservice.h>
-class FastOS_ThreadPool;
-
namespace vespalib { class TestClock; }
namespace proton {
@@ -19,11 +17,9 @@ public:
Transport();
virtual ~Transport();
FNET_Transport & transport() { return *_transport; }
- FastOS_ThreadPool & threadPool() { return *_threadPool; }
const vespalib::Clock & clock() const;
virtual void shutdown();
private:
- std::unique_ptr<FastOS_ThreadPool> _threadPool;
std::unique_ptr<FNET_Transport> _transport;
std::unique_ptr<vespalib::TestClock> _clock;
};