diff --git a/doc/developer-guide/api/types/TSRecordModeType.en.rst b/doc/developer-guide/api/types/TSRecordModeType.en.rst deleted file mode 100644 index 4e8c3e4fded..00000000000 --- a/doc/developer-guide/api/types/TSRecordModeType.en.rst +++ /dev/null @@ -1,46 +0,0 @@ -.. Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed - with this work for additional information regarding copyright - ownership. The ASF licenses this file to you under the Apache - License, Version 2.0 (the "License"); you may not use this file - except in compliance with the License. You may obtain a copy of - the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - -.. include:: ../../../common.defs - -TSRecordModeType -**************** - -Synopsis -======== - -.. code-block:: cpp - - #include - -.. c:type:: TSRecordModeType - -Enum typedef. - -Enumeration Members -=================== - -.. c:member:: TSRecordModeType TS_RECORDMODE_NULL - -.. c:member:: TSRecordModeType TS_RECORDMODE_CLIENT - -.. c:member:: TSRecordModeType TS_RECORDMODE_SERVER - -.. c:member:: TSRecordModeType TS_RECORDMODE_STAND_ALONE - -Description -=========== - diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/api/types/TSRecordModeType.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/api/types/TSRecordModeType.en.po deleted file mode 100644 index 089ce2b5326..00000000000 --- a/doc/locale/ja/LC_MESSAGES/developer-guide/api/types/TSRecordModeType.en.po +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Apache Traffic Server 6.2\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-02 21:32+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: ja_JP\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.1.1\n" - -#: ../../developer-guide/api/types/TSRecordModeType.en.rst:43 -msgid "Description" -msgstr "解説" - -#: ../../developer-guide/api/types/TSRecordModeType.en.rst:29 -msgid "Enum typedef." -msgstr "" - -#: ../../developer-guide/api/types/TSRecordModeType.en.rst:32 -msgid "Enumeration Members" -msgstr "" - -#: ../../developer-guide/api/types/TSRecordModeType.en.rst:23 -msgid "Synopsis" -msgstr "概要" - -#: ../../developer-guide/api/types/TSRecordModeType.en.rst:20 -msgid "TSRecordModeType" -msgstr "" - -#: ../../developer-guide/api/types/TSRecordModeType.en.rst:25 -msgid "`#include `" -msgstr "" diff --git a/include/records/I_RecDefs.h b/include/records/I_RecDefs.h index 5baf5d9687e..5362e5e00f6 100644 --- a/include/records/I_RecDefs.h +++ b/include/records/I_RecDefs.h @@ -121,13 +121,6 @@ enum RecSourceT { REC_SOURCE_ENV ///< Process environment variable. }; -enum RecModeT { - RECM_NULL, - RECM_CLIENT, - RECM_SERVER, - RECM_STAND_ALONE, ///< The only option now as traffic_manager is no longer supported. -}; - enum RecAccessT { RECA_NULL, RECA_NO_ACCESS, diff --git a/include/records/I_RecProcess.h b/include/records/I_RecProcess.h index 2df2572be19..1d510b12fb8 100644 --- a/include/records/I_RecProcess.h +++ b/include/records/I_RecProcess.h @@ -29,8 +29,8 @@ //------------------------------------------------------------------------- // Initialization/Starting //------------------------------------------------------------------------- -int RecProcessInit(RecModeT mode_type, Diags *diags = nullptr); -int RecProcessInitMessage(RecModeT mode_type); +int RecProcessInit(Diags *diags = nullptr); +int RecProcessInitMessage(); int RecProcessStart(); //------------------------------------------------------------------------- diff --git a/include/records/P_RecCore.h b/include/records/P_RecCore.h index 42f2e5a02bf..062bdec9df1 100644 --- a/include/records/P_RecCore.h +++ b/include/records/P_RecCore.h @@ -41,7 +41,6 @@ extern RecRecord *g_records; extern std::unordered_map g_records_ht; extern ink_rwlock g_records_rwlock; extern int g_num_records; -extern RecModeT g_mode_type; // records.yaml items extern const char *g_rec_config_fpath; @@ -52,7 +51,7 @@ extern ink_mutex g_rec_config_lock; // Initialization //------------------------------------------------------------------------- -int RecCoreInit(RecModeT mode_type, Diags *diags); +int RecCoreInit(Diags *diags); //------------------------------------------------------------------------- // Registration/Insertion diff --git a/include/ts/apidefs.h.in b/include/ts/apidefs.h.in index de29b257c8b..91e8163eba1 100644 --- a/include/ts/apidefs.h.in +++ b/include/ts/apidefs.h.in @@ -751,14 +751,6 @@ typedef enum { TS_RECORDCHECK_IP, } TSRecordCheckType; -/* The values of this enum must match enum RecModeT in I_RecDefs.h */ -typedef enum { - TS_RECORDMODE_NULL, - TS_RECORDMODE_CLIENT, - TS_RECORDMODE_SERVER, - TS_RECORDMODE_STAND_ALONE, -} TSRecordModeType; - /* The values of this enum must match enum RecAccessT in I_RecDefs.h */ typedef enum { TS_RECORDACCESS_NULL, diff --git a/iocore/aio/test_AIO.cc b/iocore/aio/test_AIO.cc index 22ac40f4614..0b9613202fb 100644 --- a/iocore/aio/test_AIO.cc +++ b/iocore/aio/test_AIO.cc @@ -412,7 +412,7 @@ main(int /* argc ATS_UNUSED */, char *argv[]) Layout::create(); init_diags("", nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); eventProcessor.start(ink_number_of_processors()); diff --git a/iocore/cache/test/main.cc b/iocore/cache/test/main.cc index 7acf2c56deb..55ef9f90ca6 100644 --- a/iocore/cache/test/main.cc +++ b/iocore/cache/test/main.cc @@ -73,7 +73,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { mime_init(); Layout::create(temp_prefix()); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); ink_net_init(ts::ModuleVersion(1, 0, ts::ModuleVersion::PRIVATE)); ink_assert(GLOBAL_DATA != nullptr); diff --git a/iocore/eventsystem/unit_tests/test_EventSystem.cc b/iocore/eventsystem/unit_tests/test_EventSystem.cc index 37a056a787f..82f8c032bc4 100644 --- a/iocore/eventsystem/unit_tests/test_EventSystem.cc +++ b/iocore/eventsystem/unit_tests/test_EventSystem.cc @@ -89,7 +89,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { { Layout::create(); init_diags("", nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); eventProcessor.start(TEST_THREADS, 1048576); // Hardcoded stacksize at 1MB diff --git a/iocore/eventsystem/unit_tests/test_IOBuffer.cc b/iocore/eventsystem/unit_tests/test_IOBuffer.cc index fe91e7e1822..9ea28d9271d 100644 --- a/iocore/eventsystem/unit_tests/test_IOBuffer.cc +++ b/iocore/eventsystem/unit_tests/test_IOBuffer.cc @@ -338,7 +338,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { { Layout::create(); init_diags("", nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); diff --git a/iocore/hostdb/test_RefCountCache.cc b/iocore/hostdb/test_RefCountCache.cc index 331694e5e7b..0e48490cb94 100644 --- a/iocore/hostdb/test_RefCountCache.cc +++ b/iocore/hostdb/test_RefCountCache.cc @@ -201,10 +201,9 @@ int test() { // Initialize IOBufAllocator - RecModeT mode_type = RECM_STAND_ALONE; Layout::create(); init_diags("", nullptr); - RecProcessInit(mode_type); + RecProcessInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); int ret = 0; diff --git a/iocore/net/quic/test/event_processor_main.cc b/iocore/net/quic/test/event_processor_main.cc index 9a6f1ad8229..e0f539e30c1 100644 --- a/iocore/net/quic/test/event_processor_main.cc +++ b/iocore/net/quic/test/event_processor_main.cc @@ -49,7 +49,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { diags()->show_location = SHOW_LOCATION_DEBUG; Layout::create(); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); QUICConfig::startup(); diff --git a/iocore/net/quic/test/main.cc b/iocore/net/quic/test/main.cc index 49dbba250ec..5b605c0cf7e 100644 --- a/iocore/net/quic/test/main.cc +++ b/iocore/net/quic/test/main.cc @@ -46,7 +46,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { diags()->show_location = SHOW_LOCATION_DEBUG; Layout::create(); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); QUICConfig::startup(); diff --git a/iocore/net/test_I_Net.cc b/iocore/net/test_I_Net.cc index 37e738adb21..e5d24a96c87 100644 --- a/iocore/net/test_I_Net.cc +++ b/iocore/net/test_I_Net.cc @@ -41,10 +41,8 @@ main() setbuf(stdout, nullptr); int nproc = ink_number_of_processors(); - RecModeT mode_type = RECM_STAND_ALONE; - init_diags("net_test", nullptr); - RecProcessInit(mode_type); + RecProcessInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); ink_net_init(NET_SYSTEM_MODULE_PUBLIC_VERSION); diff --git a/iocore/net/test_I_UDPNet.cc b/iocore/net/test_I_UDPNet.cc index 7452edfd4cc..f752f0e34f1 100644 --- a/iocore/net/test_I_UDPNet.cc +++ b/iocore/net/test_I_UDPNet.cc @@ -128,8 +128,7 @@ void udp_echo_server() { Layout::create(); - RecModeT mode_type = RECM_STAND_ALONE; - RecProcessInit(mode_type); + RecProcessInit(); Thread *main_thread = new EThread(); main_thread->set_specific(); diff --git a/mgmt/rpc/server/unit_tests/test_rpcserver.cc b/mgmt/rpc/server/unit_tests/test_rpcserver.cc index 2b0e2f4787d..9fffce978b8 100644 --- a/mgmt/rpc/server/unit_tests/test_rpcserver.cc +++ b/mgmt/rpc/server/unit_tests/test_rpcserver.cc @@ -79,7 +79,7 @@ struct RPCServerTestListener : Catch::TestEventListenerBase { { Layout::create(); init_diags("rpc|rpc.test", nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); signal(SIGPIPE, SIG_IGN); diff --git a/proxy/http/remap/unit-tests/test_PluginFactory.cc b/proxy/http/remap/unit-tests/test_PluginFactory.cc index 0c0d3c96f62..e12016b652e 100644 --- a/proxy/http/remap/unit-tests/test_PluginFactory.cc +++ b/proxy/http/remap/unit-tests/test_PluginFactory.cc @@ -48,7 +48,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { { Layout::create(); init_diags("", nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); eventProcessor.start(TEST_THREADS, 1048576); diff --git a/proxy/http2/unit_tests/main.cc b/proxy/http2/unit_tests/main.cc index 567f084e416..c4eb2101a83 100644 --- a/proxy/http2/unit_tests/main.cc +++ b/proxy/http2/unit_tests/main.cc @@ -43,7 +43,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { { Layout::create(); init_diags("", nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); diff --git a/proxy/http3/test/main.cc b/proxy/http3/test/main.cc index 11eb7136431..de4b4503a65 100644 --- a/proxy/http3/test/main.cc +++ b/proxy/http3/test/main.cc @@ -47,7 +47,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { diags()->show_location = SHOW_LOCATION_DEBUG; Layout::create(); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); diff --git a/proxy/http3/test/main_qpack.cc b/proxy/http3/test/main_qpack.cc index b6e1d594f5c..2da09058816 100644 --- a/proxy/http3/test/main_qpack.cc +++ b/proxy/http3/test/main_qpack.cc @@ -62,7 +62,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { diags()->show_location = SHOW_LOCATION_DEBUG; Layout::create(); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); QUICConfig::startup(); diff --git a/proxy/logging/LogStandalone.cc b/proxy/logging/LogStandalone.cc index 5c8ccc99561..58e80d7ec4e 100644 --- a/proxy/logging/LogStandalone.cc +++ b/proxy/logging/LogStandalone.cc @@ -100,10 +100,10 @@ initialize_process_manager() // diags should have been initialized by caller, e.g.: sac.cc ink_assert(diags()); - RecProcessInit(RECM_STAND_ALONE, diags()); + RecProcessInit(diags()); LibRecordsConfigInit(); - RecProcessInitMessage(RECM_STAND_ALONE); + RecProcessInitMessage(); // // Define version info records diff --git a/proxy/logging/unit-tests/benchmark_LogObject.cc b/proxy/logging/unit-tests/benchmark_LogObject.cc index 6a6bf6f6c98..3db7020a078 100644 --- a/proxy/logging/unit-tests/benchmark_LogObject.cc +++ b/proxy/logging/unit-tests/benchmark_LogObject.cc @@ -104,7 +104,7 @@ TEST_CASE("LogObject", "[proxy/logging]") diags()->dump(); } Layout::create("/opt/ats"); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); size_t stacksize; REC_ReadConfigInteger(stacksize, "proxy.config.thread.default.stacksize"); diff --git a/src/records/P_RecCore.cc b/src/records/P_RecCore.cc index 7dddcfde318..5530b80623a 100644 --- a/src/records/P_RecCore.cc +++ b/src/records/P_RecCore.cc @@ -36,8 +36,6 @@ #include -RecModeT g_mode_type = RECM_NULL; - //------------------------------------------------------------------------- // RecRegisterStatXXX //------------------------------------------------------------------------- @@ -338,33 +336,25 @@ RecSyncStatsFile() bool sync_to_disk; ats_scoped_str snap_fpath(RecConfigReadPersistentStatsPath()); - /* - * g_mode_type should be initialized by - * RecLocalInit() or RecProcessInit() earlier. - */ - ink_assert(g_mode_type != RECM_NULL); - - if (g_mode_type == RECM_SERVER || g_mode_type == RECM_STAND_ALONE) { - m = RecMessageAlloc(RECG_NULL); - num_records = g_num_records; - sync_to_disk = false; - for (i = 0; i < num_records; i++) { - r = &(g_records[i]); - rec_mutex_acquire(&(r->lock)); - if (REC_TYPE_IS_STAT(r->rec_type)) { - if (r->stat_meta.persist_type == RECP_PERSISTENT) { - m = RecMessageMarshal_Realloc(m, r); - sync_to_disk = true; - } + m = RecMessageAlloc(RECG_NULL); + num_records = g_num_records; + sync_to_disk = false; + for (i = 0; i < num_records; i++) { + r = &(g_records[i]); + rec_mutex_acquire(&(r->lock)); + if (REC_TYPE_IS_STAT(r->rec_type)) { + if (r->stat_meta.persist_type == RECP_PERSISTENT) { + m = RecMessageMarshal_Realloc(m, r); + sync_to_disk = true; } - rec_mutex_release(&(r->lock)); - } - if (sync_to_disk) { - RecDebug(DL_Note, "Writing '%s' [%d bytes]", (const char *)snap_fpath, m->o_write - m->o_start + sizeof(RecMessageHdr)); - RecMessageWriteToDisk(m, snap_fpath); } - RecMessageFree(m); + rec_mutex_release(&(r->lock)); + } + if (sync_to_disk) { + RecDebug(DL_Note, "Writing '%s' [%d bytes]", (const char *)snap_fpath, m->o_write - m->o_start + sizeof(RecMessageHdr)); + RecMessageWriteToDisk(m, snap_fpath); } + RecMessageFree(m); return REC_ERR_OKAY; } diff --git a/src/records/RecCore.cc b/src/records/RecCore.cc index c284fea9612..7f9212ed883 100644 --- a/src/records/RecCore.cc +++ b/src/records/RecCore.cc @@ -190,7 +190,7 @@ link_string_alloc(const char * /* name */, RecDataT /* data_type */, RecData dat // RecCoreInit //------------------------------------------------------------------------- int -RecCoreInit(RecModeT mode_type, Diags *_diags) +RecCoreInit(Diags *_diags) { if (g_initialized) { return REC_ERR_OKAY; @@ -211,42 +211,38 @@ RecCoreInit(RecModeT mode_type, Diags *_diags) ink_rwlock_init(&g_records_rwlock); // read stats - if ((mode_type == RECM_SERVER) || (mode_type == RECM_STAND_ALONE)) { - RecReadStatsFile(); - } + RecReadStatsFile(); // read configs - if ((mode_type == RECM_SERVER) || (mode_type == RECM_STAND_ALONE)) { - bool file_exists = true; + bool file_exists = true; - ink_mutex_init(&g_rec_config_lock); + ink_mutex_init(&g_rec_config_lock); - g_rec_config_fpath = ats_stringdup(RecConfigReadConfigPath(nullptr, ts::filename::RECORDS)); + g_rec_config_fpath = ats_stringdup(RecConfigReadConfigPath(nullptr, ts::filename::RECORDS)); - // Make sure there is no legacy file, if so we drop a BIG WARNING and fail. - // This is to avoid issues with someone ignoring that we now use records.yaml - ts::file::path old_config{RecConfigReadConfigPath(nullptr, "records.config")}; - if (ts::file::exists(old_config)) { - RecLog(DL_Fatal, - "**** Found a legacy config file (%s). Please remove it and migrate to the new YAML format before continuing. ****", - old_config.c_str()); - } + // Make sure there is no legacy file, if so we drop a BIG WARNING and fail. + // This is to avoid issues with someone ignoring that we now use records.yaml + ts::file::path old_config{RecConfigReadConfigPath(nullptr, "records.config")}; + if (ts::file::exists(old_config)) { + RecLog(DL_Fatal, + "**** Found a legacy config file (%s). Please remove it and migrate to the new YAML format before continuing. ****", + old_config.c_str()); + } - if (RecFileExists(g_rec_config_fpath) == REC_ERR_FAIL) { - RecLog(DL_Warning, "Could not find '%s', system will run with defaults\n", ts::filename::RECORDS); - file_exists = false; - } + if (RecFileExists(g_rec_config_fpath) == REC_ERR_FAIL) { + RecLog(DL_Warning, "Could not find '%s', system will run with defaults\n", ts::filename::RECORDS); + file_exists = false; + } - if (file_exists) { - auto err = RecReadYamlConfigFile(); - RecLog(DL_Note, "records parsing completed."); - if (!err.empty()) { - std::string text; - RecLog(DL_Note, "%s", swoc::bwprint(text, "{}", err).c_str()); - } - } else { - RecLog(DL_Note, "%s does not exist.", g_rec_config_fpath); + if (file_exists) { + auto err = RecReadYamlConfigFile(); + RecLog(DL_Note, "records parsing completed."); + if (!err.empty()) { + std::string text; + RecLog(DL_Note, "%s", swoc::bwprint(text, "{}", err).c_str()); } + } else { + RecLog(DL_Note, "%s does not exist.", g_rec_config_fpath); } RecLog(DL_Note, "%s finished loading", std::string{g_rec_config_fpath}.c_str()); diff --git a/src/records/RecProcess.cc b/src/records/RecProcess.cc index c046fb214dd..884120a817b 100644 --- a/src/records/RecProcess.cc +++ b/src/records/RecProcess.cc @@ -50,18 +50,16 @@ static Event *sync_cont_event; bool i_am_the_record_owner(RecT rec_type) { - if (g_mode_type == RECM_STAND_ALONE) { - switch (rec_type) { - case RECT_CONFIG: - case RECT_PROCESS: - case RECT_NODE: - case RECT_LOCAL: - case RECT_PLUGIN: - return true; - default: - ink_assert(!"Unexpected RecT type"); - return false; - } + switch (rec_type) { + case RECT_CONFIG: + case RECT_PROCESS: + case RECT_NODE: + case RECT_LOCAL: + case RECT_PLUGIN: + return true; + default: + ink_assert(!"Unexpected RecT type"); + return false; } return false; @@ -166,7 +164,7 @@ struct sync_cont : public Continuation { // RecProcessInit //------------------------------------------------------------------------- int -RecProcessInit(RecModeT mode_type, Diags *_diags) +RecProcessInit(Diags *_diags) { static bool initialized_p = false; @@ -174,9 +172,7 @@ RecProcessInit(RecModeT mode_type, Diags *_diags) return REC_ERR_OKAY; } - g_mode_type = mode_type; - - if (RecCoreInit(mode_type, _diags) == REC_ERR_FAIL) { + if (RecCoreInit(_diags) == REC_ERR_FAIL) { return REC_ERR_FAIL; } @@ -188,14 +184,13 @@ RecProcessInit(RecModeT mode_type, Diags *_diags) void RecMessageInit() { - ink_assert(g_mode_type != RECM_NULL); message_initialized_p = true; } //------------------------------------------------------------------------- // RecProcessInitMessage //------------------------------------------------------------------------- int -RecProcessInitMessage(RecModeT mode_type) +RecProcessInitMessage() { static bool initialized_p = false; diff --git a/src/records/test_RecProcess.i b/src/records/test_RecProcess.i index 70c756b9603..98acbfbc548 100644 --- a/src/records/test_RecProcess.i +++ b/src/records/test_RecProcess.i @@ -564,10 +564,6 @@ int main(int argc, char **argv) { - RecModeT mode_type = RECM_STAND_ALONE; - if ((argc == 2) && (strcmp(argv[1], "-M") == 0)) { - mode_type = RECM_CLIENT; - } // Start diags logging FILE *log_fp; if ((log_fp = fopen("recprocess.log", "a+")) != NULL) { @@ -584,11 +580,9 @@ main(int argc, char **argv) // System initialization. Note that a pointer to the diags object // is passed into librecprocess.a. If manager isn't running, we // need to register our own configs - RecProcessInit(mode_type, diags); - RecProcessInitMessage(mode_type); - if (mode_type == RECM_STAND_ALONE) { + RecProcessInit( diags); + RecProcessInitMessage(); RecordsConfigRegister(); - } ink_event_system_init(EVENT_SYSTEM_MODULE_VERSION); eventProcessor.start(4); RecProcessStart(); diff --git a/src/records/unit_tests/unit_test_main_on_eventsystem.cc b/src/records/unit_tests/unit_test_main_on_eventsystem.cc index 1df1d9863c0..8e918da0e26 100644 --- a/src/records/unit_tests/unit_test_main_on_eventsystem.cc +++ b/src/records/unit_tests/unit_test_main_on_eventsystem.cc @@ -43,7 +43,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase { { Layout::create(); init_diags("", nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION); eventProcessor.start(TEST_THREADS); diff --git a/src/traffic_crashlog/traffic_crashlog.cc b/src/traffic_crashlog/traffic_crashlog.cc index 83dd081db72..47b67dd5902 100644 --- a/src/traffic_crashlog/traffic_crashlog.cc +++ b/src/traffic_crashlog/traffic_crashlog.cc @@ -165,7 +165,7 @@ main(int /* argc ATS_UNUSED */, const char **argv) runroot_handler(argv); Layout::create(); - RecProcessInit(RECM_STAND_ALONE, nullptr /* diags */); + RecProcessInit(nullptr /* diags */); LibRecordsConfigInit(); if (syslog_mode) { diff --git a/src/traffic_layout/engine.cc b/src/traffic_layout/engine.cc index 5adcc0fa3dc..7ba0e120efb 100644 --- a/src/traffic_layout/engine.cc +++ b/src/traffic_layout/engine.cc @@ -661,7 +661,7 @@ LayoutEngine::verify_runroot() if (arguments.get("with-user")) { user = arguments.get("with-user").value(); } else { - RecProcessInit(RECM_STAND_ALONE, nullptr /* diags */); + RecProcessInit(nullptr /* diags */); LibRecordsConfigInit(); if (RecGetRecordString("proxy.config.admin.user_id", user_buf, sizeof(user_buf)) != 0 || strlen(user_buf) == 0) { user = user_buf; diff --git a/src/traffic_layout/info.cc b/src/traffic_layout/info.cc index 529ca1876c6..e9ed63a1392 100644 --- a/src/traffic_layout/info.cc +++ b/src/traffic_layout/info.cc @@ -149,7 +149,7 @@ print_var(std::string_view const &name, std::string_view const &value, bool json void produce_layout(bool json) { - RecProcessInit(RECM_STAND_ALONE, nullptr /* diags */); + RecProcessInit(nullptr /* diags */); LibRecordsConfigInit(); if (json) { diff --git a/src/traffic_quic/traffic_quic.cc b/src/traffic_quic/traffic_quic.cc index ee6285da3f6..f61db271e90 100644 --- a/src/traffic_quic/traffic_quic.cc +++ b/src/traffic_quic/traffic_quic.cc @@ -84,7 +84,7 @@ main(int argc, const char **argv) } init_diags(config.debug_tags, nullptr); - RecProcessInit(RECM_STAND_ALONE); + RecProcessInit(); LibRecordsConfigInit(); Debug("quic_client", "Load configs from %s", RecConfigReadConfigDir().c_str()); diff --git a/src/traffic_server/traffic_server.cc b/src/traffic_server/traffic_server.cc index 7328eb65076..46acf960cbb 100644 --- a/src/traffic_server/traffic_server.cc +++ b/src/traffic_server/traffic_server.cc @@ -669,10 +669,10 @@ initialize_process_manager() { mgmt_use_syslog(); - RecProcessInit(RECM_STAND_ALONE, diags()); + RecProcessInit(diags()); LibRecordsConfigInit(); - RecProcessInitMessage(RECM_STAND_ALONE); + RecProcessInitMessage(); check_config_directories(); //