Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ common --//score/datarouter/build_configuration_flags:persistent_logging=False
common --//score/datarouter/build_configuration_flags:persistent_config_feature_enabled=False
common --//score/datarouter/build_configuration_flags:enable_nonverbose_dlt=False
common --//score/datarouter/build_configuration_flags:enable_dynamic_configuration_in_datarouter=False
common --//score/datarouter/build_configuration_flags:file_transfer=False
common --//score/datarouter/build_configuration_flags:dlt_file_transfer_feature=False
common --//score/datarouter/build_configuration_flags:use_local_vlan=True

build --incompatible_strict_action_env
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ bazel_dep(name = "rapidjson", version = "1.1.0")
bazel_dep(name = "score_communication", version = "0.1.2")
git_override(
module_name = "score_communication",
commit = "42eb047495099ec70b5c8773f29783cc205bf7df",
commit = "5a70133dd8bd632f5c07f200a5ee4bc9f507c23b",
remote = "https://github.com/eclipse-score/communication.git",
)

bazel_dep(name = "score_baselibs", version = "0.2.0")
git_override(
module_name = "score_baselibs",
commit = "99d49637a2199f33a71edc479d39970e3bdcb271",
commit = "3c65b223e9f516f95935bb4cd2e83d6088ca016f",
remote = "https://github.com/eclipse-score/baselibs.git",
)

Expand Down
49 changes: 21 additions & 28 deletions score/datarouter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ cc_library(
strip_include_prefix = "include",
visibility = [
"//score/datarouter/dlt_filetransfer_trigger_lib:__pkg__",
"//score/datarouter/src/file_transfer:__subpackages__",
"//score/datarouter/src/persistent_logging/persistent_logging:__pkg__",
"//score/datarouter/file_transfer:__subpackages__",
"//score/datarouter/persistent_logging/persistent_logging:__pkg__",
"//score/datarouter/test:__subpackages__",
],
deps = [
Expand Down Expand Up @@ -109,7 +109,6 @@ cc_library(
"//score/datarouter/dynamic_configuration/i_session",
"@score_baselibs//score/os:pthread",
"@score_baselibs//score/os:sys_poll",
"@score_baselibs//score/quality/compiler_warnings",
],
)

Expand All @@ -129,7 +128,6 @@ cc_library(
"//score/datarouter/dynamic_configuration/i_session",
"@score_baselibs//score/os:pthread",
"@score_baselibs//score/os:sys_poll",
"@score_baselibs//score/quality/compiler_warnings",
],
)

Expand Down Expand Up @@ -164,11 +162,11 @@ cc_library(
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
visibility = [
"//score/datarouter/file_transfer:__subpackages__",
"//score/datarouter/nonverbose_dlt:__pkg__",
"//score/datarouter/nonverbose_dlt_stub:__pkg__",
"//score/datarouter/src/file_transfer:__subpackages__",
"//score/datarouter/src/persistent_logging:__pkg__",
"//score/datarouter/src/persistent_logging/persistent_logging:__pkg__",
"//score/datarouter/persistent_logging:__pkg__",
"//score/datarouter/persistent_logging/persistent_logging:__pkg__",
"//score/datarouter/test:__subpackages__",
],
deps = [
Expand All @@ -187,11 +185,11 @@ cc_library(
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
visibility = [
"//score/datarouter/file_transfer:__subpackages__",
"//score/datarouter/nonverbose_dlt:__pkg__",
"//score/datarouter/nonverbose_dlt_stub:__pkg__",
"//score/datarouter/src/file_transfer:__subpackages__",
"//score/datarouter/src/persistent_logging:__pkg__",
"//score/datarouter/src/persistent_logging/persistent_logging:__pkg__",
"//score/datarouter/persistent_logging:__pkg__",
"//score/datarouter/persistent_logging/persistent_logging:__pkg__",
],
deps = [
":datarouter_types",
Expand Down Expand Up @@ -450,7 +448,7 @@ cc_library(
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
visibility = [
"//score/datarouter/src/file_transfer:__subpackages__",
"//score/datarouter/file_transfer:__subpackages__",
],
deps = [
":dltprotocol",
Expand Down Expand Up @@ -494,7 +492,7 @@ cc_library(
],
"//conditions:default": [],
}) + select({
"//score/datarouter/build_configuration_flags:config_file_transfer": ["DLT_FILE_TRANSFER_FEATURE"],
"//score/datarouter/build_configuration_flags:config_dlt_file_transfer": ["DLT_FILE_TRANSFER_FEATURE"],
"//conditions:default": [],
}) + select({
"//score/datarouter/build_configuration_flags:config_persistent_logging": ["PERSISTENT_LOGGING"],
Expand All @@ -510,11 +508,11 @@ cc_library(
],
"//conditions:default": ["//score/datarouter/src/persistency/stub_persistent_dictionary:stub_persistent_dictionary_factory"],
}) + select({
"//score/datarouter/build_configuration_flags:config_file_transfer": [
"//score/datarouter/src/file_transfer/file_transfer_impl:file_transfer_stream_handler",
"//score/datarouter/build_configuration_flags:config_dlt_file_transfer": [
"//score/datarouter/file_transfer/file_transfer_impl:file_transfer_stream_handler",
],
"//conditions:default": [
"//score/datarouter/src/file_transfer/file_transfer_stub:file_transfer_stream_handler_stub",
"//score/datarouter/file_transfer/file_transfer_stub:file_transfer_stream_handler_stub",
],
}) + select({
"//score/datarouter/build_configuration_flags:config_datarouter_nonverbose_dlt": [
Expand All @@ -532,10 +530,10 @@ cc_library(
],
}) + select({
"//score/datarouter/build_configuration_flags:config_persistent_logging": [
"//score/datarouter/src/persistent_logging/persistent_logging_stub:sysedr_stub",
"//score/datarouter/persistent_logging/persistent_logging_stub:sysedr_stub",
],
"//conditions:default": [
"//score/datarouter/src/persistent_logging/persistent_logging_stub:sysedr_stub",
"//score/datarouter/persistent_logging/persistent_logging_stub:sysedr_stub",
],
}),
)
Expand Down Expand Up @@ -595,7 +593,7 @@ cc_library(
":udp_stream_output",
":unixdomain_server",
"//score/datarouter/network:vlan",
"//score/datarouter/src/persistent_logging/persistent_logging_stub:sysedr_stub",
"//score/datarouter/persistent_logging/persistent_logging_stub:sysedr_stub",
"@score_baselibs//score/language/futurecpp",
"@score_baselibs//score/mw/log/configuration:nvconfig",
"@score_baselibs//score/os:socket",
Expand Down Expand Up @@ -762,10 +760,7 @@ cc_library(
"//conditions:default": [],
}),
strip_include_prefix = "include",
visibility = [
"//score/datarouter:__pkg__",
"//score/datarouter/test:__subpackages__",
],
visibility = ["//visibility:private"],
deps = [
":datarouter_feature_config",
":datarouter_lib",
Expand All @@ -775,7 +770,7 @@ cc_library(
"@score_baselibs//score/mw/log/configuration:nvconfigfactory",
] + select({
"//score/datarouter/build_configuration_flags:config_persistent_logging": [
"//score/datarouter/src/persistent_logging/persistent_logging_stub:sysedr_stub",
"//score/datarouter/persistent_logging/persistent_logging_stub:sysedr_stub",
],
"//conditions:default": [],
}),
Expand Down Expand Up @@ -807,7 +802,7 @@ cc_library(
"@score_baselibs//score/mw/log/configuration:nvconfigfactory",
] + select({
"//score/datarouter/build_configuration_flags:config_persistent_logging": [
"//score/datarouter/src/persistent_logging/persistent_logging_stub:sysedr_stub",
"//score/datarouter/persistent_logging/persistent_logging_stub:sysedr_stub",
],
"//conditions:default": [],
}),
Expand Down Expand Up @@ -863,9 +858,8 @@ cc_library(
"//score/datarouter/daemon_communication:daemon_session_handle_interface",
"//score/mw/log/detail/data_router:message_passing_interface",
"//score/mw/log/detail/data_router/shared_memory:reader",
"@score_baselibs//score/concurrency",
"@score_baselibs//score/os:pthread",
"@score_communication//score/message_passing",
"@score_communication//score/mw/com/message_passing",
],
)

Expand Down Expand Up @@ -1043,7 +1037,7 @@ cc_library(
":log",
"@score_baselibs//score/mw/log/configuration:nvconfig",
"//score/datarouter/dlt_filetransfer_trigger_lib:filetransfer_message_types",
"//score/datarouter/src/persistent_logging/persistent_logging_stub:sysedr_stub",
"//score/datarouter/persistent_logging/persistent_logging_stub:sysedr_stub",
],
)

Expand All @@ -1054,7 +1048,6 @@ cc_library(
test_suite(
name = "unit_tests",
tests = [
"//score/datarouter/lib/synchronized:synchronized_test",
#"//score/datarouter/persistent_log_request:unit_tests",
#"//score/datarouter/test:unit_tests",
#"//score/datarouter/tools/generator:unit_tests",
Expand Down
6 changes: 3 additions & 3 deletions score/datarouter/build_configuration_flags/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ config_setting(
)

bool_flag(
name = "file_transfer",
name = "dlt_file_transfer_feature",
build_setting_default = True,
)

config_setting(
name = "config_file_transfer",
name = "config_dlt_file_transfer",
flag_values = {
":file_transfer": "True",
":dlt_file_transfer_feature": "True",
},
visibility = [
"//score/datarouter:__subpackages__",
Expand Down
12 changes: 0 additions & 12 deletions score/datarouter/daemon_communication/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@

load("@rules_cc//cc:defs.bzl", "cc_library")
load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES")
load("@score_baselibs//score/quality/clang_tidy:extra_checks.bzl", "clang_tidy_extra_checks")

clang_tidy_extra_checks(
name = "clang_tidy_extra_checks",
extra_features = [
"spp_code_style_check_header_guards",
"spp_code_style_check_method_names",
"spp_code_style_check_readability",
"spp_code_style_check_type_names",
"spp_code_style_check_variable_names",
],
)

cc_library(
name = "daemon_session_handle_interface",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace daemon
class ISessionHandle
{
public:
virtual bool AcquireRequest() const = 0;
virtual void AcquireRequest() const = 0;
virtual ~ISessionHandle() = default;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace score::platform::internal::daemon::mock
class SessionHandleMock : public score::platform::internal::daemon::ISessionHandle
{
public:
MOCK_METHOD(bool, AcquireRequest, (), (const, override));
MOCK_METHOD(void, AcquireRequest, (), (const, override));
};

} // namespace score::platform::internal::daemon::mock
Expand Down
58 changes: 22 additions & 36 deletions score/datarouter/datarouter/data_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ std::unique_ptr<DataRouter::SourceSession> DataRouter::new_source_session_impl(
std::unique_ptr<score::mw::log::detail::ISharedMemoryReader> reader,
const score::mw::log::NvConfig& nvConfig)
{
std::lock_guard<std::mutex> lock(subscriber_mutex_);

auto sourceSession =
std::make_unique<DataRouter::SourceSession>(*this,
std::move(reader),
Expand All @@ -132,19 +134,6 @@ std::unique_ptr<DataRouter::SourceSession> DataRouter::new_source_session_impl(
quota_enforcement_enabled,
stats_logger_,
std::make_unique<score::platform::internal::LogParser>(nvConfig));

if (!sourceSession)
{
return nullptr;
}

std::lock_guard<std::mutex> lock(subscriber_mutex_);

// Insert is protected by subscriber_mutex_ held by caller (new_source_session_impl).
// This relies on the calling convention that SourceSession is only constructed
// from new_source_session_impl() which acquires the lock before construction.
std::ignore = sources_.insert(sourceSession.get());

if (sourceCallback_)
{
sourceCallback_(std::move(sourceSession->get_parser()));
Expand Down Expand Up @@ -279,8 +268,9 @@ void DataRouter::SourceSession::processAndRouteLogMessages(uint64_t& message_cou
if ((peek_bytes.has_value() && peek_bytes.value() > 0) ||
(cmd->ticks_without_write > kTicksWithoutAcquireWhileNoWrites))
{
cmd->acquire_requested = request_acquire();
needs_fast_reschedule = cmd->acquire_requested;
cmd->acquire_requested = true;
request_acquire();
needs_fast_reschedule = true;
}
else
{
Expand All @@ -289,8 +279,9 @@ void DataRouter::SourceSession::processAndRouteLogMessages(uint64_t& message_cou
}
else
{
cmd->acquire_requested = request_acquire();
needs_fast_reschedule = cmd->acquire_requested;
cmd->acquire_requested = true;
request_acquire();
needs_fast_reschedule = true;
}
}
}
Expand Down Expand Up @@ -386,6 +377,8 @@ DataRouter::SourceSession::SourceSession(DataRouter& router,
stats->name = name;
}

std::ignore = router_.sources_.insert(this);

{
auto stats = stats_data_.lock();
if (stats->name == "DR")
Expand Down Expand Up @@ -531,26 +524,19 @@ void DataRouter::SourceSession::show_stats()
}
}

bool DataRouter::SourceSession::request_acquire()
void DataRouter::SourceSession::request_acquire()
{
const bool acquire_result =
score::cpp::visit(score::cpp::overload(
[](UnixDomainServer::SessionHandle& handle) {
handle.pass_message("<");
return true;
},
[](score::cpp::pmr::unique_ptr<score::platform::internal::daemon::ISessionHandle>& handle) {
return handle->AcquireRequest();
// For the quality team argumentation, kindly, check Ticket-200702 and Ticket-229594.
}), // LCOV_EXCL_LINE : tooling issue. no code to test in this line.
handle_);

if (acquire_result)
{
++(stats_data_.lock()->count_acquire_requests);
}

return acquire_result;
++(stats_data_.lock()->count_acquire_requests);

score::cpp::visit(score::cpp::overload(
[](UnixDomainServer::SessionHandle& handle) {
handle.pass_message("<");
},
[](score::cpp::pmr::unique_ptr<score::platform::internal::daemon::ISessionHandle>& handle) {
handle->AcquireRequest();
// For the quality team argumentation, kindly, check Ticket-200702 and Ticket-229594.
}), // LCOV_EXCL_LINE : tooling issue. no code to test in this line.
handle_);
}

void DataRouter::SourceSession::on_acquire_response(const score::mw::log::detail::ReadAcquireResult& acq)
Expand Down
2 changes: 1 addition & 1 deletion score/datarouter/datarouter/data_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class DataRouter
void on_closed_by_peer() override;

void checkAndSetQuotaEnforcement();
bool request_acquire();
void request_acquire();

Synchronized<LocalSubscriberData> local_subscriber_data_;
Synchronized<CommandData> command_data_;
Expand Down
12 changes: 0 additions & 12 deletions score/datarouter/dlt_filetransfer_trigger_lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@

load("@rules_cc//cc:defs.bzl", "cc_library")
load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES")
load("@score_baselibs//score/quality/clang_tidy:extra_checks.bzl", "clang_tidy_extra_checks")

clang_tidy_extra_checks(
name = "clang_tidy_extra_checks",
extra_features = [
"spp_code_style_check_header_guards",
"spp_code_style_check_method_names",
"spp_code_style_check_readability",
"spp_code_style_check_type_names",
"spp_code_style_check_variable_names",
],
)

## ===========================================================================
## File transfer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct FileTransferEntry
// Unavoidable use of of union type, in future dltit_t with LoggingIdentifier.
// coverity[autosar_cpp14_a9_5_1_violation] see above
score::platform::dltid_t ctxid{};
std::string file_name{};
std::string file_name = "";
uint8_t delete_file = 0;
};

Expand Down
Loading