Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ff9faa1
Moves transformation rules to common post.bara.sky
rmaddikery Feb 27, 2026
dca9050
The feature adds missing warnings options to target toolchain.
Feb 4, 2026
90739e3
DltidT struct optimization and refactoring
Aug 24, 2025
4376731
pas: Fix clang-tidy findings in logging
Feb 16, 2026
085f857
Refer to puml instead of kroki
Feb 26, 2026
2edef43
bazel: set default private visibility for config visibility SWP-211841
Jan 20, 2026
e348af2
remove config flag aeb_restrict_acceleration_limit
Feb 12, 2026
72fca3c
Promote the generic Synchronized<T> to baselibs
RSingh1511 Nov 28, 2025
f4d8490
`lock() -> LockedPtr`; UnlockGuard via LockedPtr
sankurm Jan 13, 2026
bfe4736
Synchronized related cleanup in logging
sankurm Jan 29, 2026
f0fc926
Remove concurrency internal transitive dependencies
sankurm Mar 6, 2026
1c013e6
Coverity: AUTOSAR C++14 A15-5-3
mostafayasin93 Feb 25, 2026
ffa26e6
Coverity: AUTOSAR C++14 A0-1-3
mostafayasin93 Feb 25, 2026
0ff8230
[UML] convert and update uml in mw/log - part3
Mar 13, 2026
aa829d0
pas: Explicitly load rules_cc and rules_python load
limdor Mar 25, 2026
dba2432
qnx_unit_tests: Fix flaky unix_domain_server_test bind race condition
ltekieli Mar 23, 2026
7306b48
Adds RegistryAwareRecorderFactory
rmaddikery Mar 20, 2026
cbee239
Adds file backend plugin registrant
rmaddikery Mar 20, 2026
f6e2984
Adds remote DLT backend plugin registrant
rmaddikery Mar 20, 2026
5caa72b
Adds slog backend plugin registrant for QNX
rmaddikery Mar 20, 2026
2ebd799
Provide mw/log:minimal target as a stub empty backend
rmaddikery Mar 20, 2026
3f7e9a8
Moves composite_recorder to detail
rmaddikery Mar 25, 2026
2c2b864
Removes redundant recorder_config.h
rmaddikery Mar 31, 2026
4a6ae7a
Fix unused variable warning
Mar 9, 2026
ec0f62e
Logging daemon domain: Add IsOutputEnabled method
Apr 1, 2026
8e85fce
LogParser: Remove handler erase capability
Apr 1, 2026
6e1d784
LogParser: Pass handlers in constructor
Apr 1, 2026
7c30e2e
LogParser: Simplify TypeHandler handling
Apr 1, 2026
e9799b2
LogParser: Document thread-safety
Apr 1, 2026
f112843
Datarouter: Create LogParserFactory
Apr 2, 2026
a2531ed
Datarouter: optimize handlers calls in socketserver
Apr 2, 2026
79b67a6
Datarouter: remove duplicated files for tests
Apr 2, 2026
0356612
Datarouter, LogParser: apply const
Apr 2, 2026
b523073
Datarouter: Remove dead code FilterFactory
Apr 2, 2026
a418432
Datarouter: Delegate IOutputEnabled to GetDltEnabled
Apr 2, 2026
2af4f01
Update line coverage for aas/mw/log
Feb 23, 2026
17a03c6
Fix deps for oss export
rmaddikery Apr 17, 2026
7e5177f
Datarouter: Concurrency issues fix
Apr 17, 2026
e22636d
Datarouter: Extract GetCoredumpChannel function
Apr 17, 2026
fbc6bbe
Datarouter: Move GetCoredumpChannel to private API
Apr 17, 2026
22e2449
Move diagrams to respective design docs
rmaddikery Apr 21, 2026
e7614f3
Update verbose_logging sequence diagrams
rmaddikery Apr 21, 2026
776cb6e
Consolidate all backend design docs in backend dir
rmaddikery Apr 21, 2026
2bd43c5
Update diagram references in README files for restructured design docs
Y-Vaishnavi Apr 21, 2026
57a8e81
DatarouterConf: Move Component Local ITFs into own directory
Apr 20, 2026
d59b6ba
fix: update dependencies and resolve build errors
Y-Vaishnavi Apr 27, 2026
680833a
Fix: Adds missing x86_64_qnx feature to rust_test target
rmaddikery Apr 28, 2026
eac00f8
Adds deprecation warning for mw/log target
rmaddikery Apr 29, 2026
6fb7f46
score_log_bridge: add file, remote, and slog backend deps
rmaddikery Apr 30, 2026
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
15 changes: 2 additions & 13 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,8 @@ python.toolchain(

bazel_dep(name = "googletest", version = "1.17.0.bcr.1")
bazel_dep(name = "rapidjson", version = "1.1.0")
bazel_dep(name = "score_baselibs", version = "0.2.4")
git_override(
module_name = "score_baselibs",
commit = "4b67ce1929575801405c77f7e3c79ab36156a976",
remote = "https://github.com/eclipse-score/baselibs.git",
)

bazel_dep(name = "score_communication", version = "0.1.2")
git_override(
module_name = "score_communication",
commit = "56448a5589a5f7d3921b873e8127b824a8c1ca95",
remote = "https://github.com/eclipse-score/communication.git",
)
bazel_dep(name = "score_baselibs", version = "0.2.7")
bazel_dep(name = "score_communication", version = "0.2.1")

# Rust dependencies

Expand Down
1,826 changes: 723 additions & 1,103 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

59 changes: 43 additions & 16 deletions score/datarouter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,12 @@ clang_tidy_extra_checks(

cc_library(
name = "dltprotocol",
srcs = [
"src/dlt/dltid_converter.cpp",
],
hdrs = [
"include/dlt/dlt_common.h",
"include/dlt/dlt_headers.h",
"include/dlt/dlt_protocol.h",
"include/dlt/dlt_types.h",
"include/dlt/dltid.h",
"include/dlt/dltid_converter.h",
"include/dlt/logentry_trace.h",
"include/dlt/plogfilterdesc.h",
],
Expand Down Expand Up @@ -213,6 +209,7 @@ cc_library(
":log",
":logparser_interface",
"//score/mw/log/detail/data_router/shared_memory:reader",
"@score_baselibs//score/mw/log/configuration:nvconfig",
"@score_baselibs//score/static_reflection_with_serialization/serialization",
],
)
Expand Down Expand Up @@ -250,6 +247,38 @@ cc_library(
],
)

cc_library(
name = "logparser_factory_interface",
hdrs = [
"include/logparser/i_log_parser_factory.h",
],
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
visibility = [
"//score/datarouter/src/dlt/nonverbose_dlt_impl:__pkg__",
"//score/datarouter/src/dlt/nonverbose_dlt_stub:__pkg__",
"//score/datarouter/test:__subpackages__",
"@score_logging//score/datarouter:__subpackages__",
],
deps = [
":logparser_interface",
],
)

cc_library(
name = "logparser_factory_mock",
hdrs = [
"mocks/log_parser_factory_mock.h",
],
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "mocks",
visibility = ["//score/datarouter/test:__subpackages__"],
deps = [
":logparser_factory_interface",
"@googletest//:gtest_main",
],
)

## ===========================================================================
## libtracing
## ---------------------------------------------------------------------------
Expand Down Expand Up @@ -279,19 +308,18 @@ cc_library(
],
)

# FIXME: Ticket-252685
alias(
name = "libtracing",
actual = ":log",
visibility = ["//visibility:public"],
)

# FIXME: Ticket-252685
cc_library(
name = "log",
visibility = ["//visibility:public"],
deps = [
"//score/mw/log/detail/common:recorder_factory",
"@score_baselibs//score/mw/log:frontend",
],
deps = ["@score_baselibs//score/mw/log:console"],
)

## ===========================================================================
Expand Down Expand Up @@ -403,10 +431,11 @@ cc_library(
":datarouter_types",
":log",
":logparser",
":logparser_factory_interface",
":message_passing_server",
":unixdomain_server",
"//score/datarouter/lib/synchronized:synchronized_utility",
"//score/mw/log/detail/data_router/shared_memory:reader",
"@score_baselibs//score/concurrency:synchronized",
"@score_baselibs//score/language/futurecpp",
],
)
Expand All @@ -426,9 +455,10 @@ cc_library(
deps = [
":log",
":logparser",
":logparser_factory_interface",
":message_passing_server",
":unixdomain_mock",
"//score/datarouter/lib/synchronized:synchronized_utility",
"@score_baselibs//score/concurrency:synchronized",
],
)

Expand All @@ -447,10 +477,11 @@ cc_library(
deps = [
":datarouter_types",
":log",
":logparser_factory_interface",
":logparser_testing",
":message_passing_server",
":unixdomain_mock",
"//score/datarouter/lib/synchronized:synchronized_utility",
"@score_baselibs//score/concurrency:synchronized",
],
)

Expand Down Expand Up @@ -708,11 +739,9 @@ cc_library(
name = "socketserver_config_lib",
srcs = [
"src/daemon/socketserver_config.cpp",
"src/daemon/socketserver_filter_factory.cpp",
],
hdrs = [
"include/daemon/socketserver_config.h",
"include/daemon/socketserver_filter_factory.h",
],
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
Expand All @@ -738,11 +767,9 @@ cc_library(
testonly = True,
srcs = [
"src/daemon/socketserver_config.cpp",
"src/daemon/socketserver_filter_factory.cpp",
],
hdrs = [
"include/daemon/socketserver_config.h",
"include/daemon/socketserver_filter_factory.h",
],
features = COMPILER_WARNING_FEATURES,
strip_include_prefix = "include",
Expand Down Expand Up @@ -875,6 +902,7 @@ cc_binary(
],
deps = [
":datarouter_app",
"@score_baselibs//score/os:errno_logging",
"@score_baselibs//score/os:pthread",
"@score_baselibs//score/os/utils:path",
# "//third_party/jemalloc", # Ticket-231781
Expand Down Expand Up @@ -1091,7 +1119,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
15 changes: 15 additions & 0 deletions score/datarouter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ Example gap detection message:
```
The source ID corresponds to its PID. In this example, the source with PID `485` lost 37 messages because the datarouter did not read the ring buffer fast enough.

## Thread Safety — LogParser

Each `LogParser` instance is owned by exactly one `SourceSession` inside the
datarouter. It is **not** thread-safe, but the current design guarantees
correctness through structural single-threading:

| Concern | Guarantee |
|---|---|
| **Handler maps** (`handle_request_map_`, `global_handlers_`) | Populated once at construction via constructor injection and never mutated afterward (fix for Ticket-254408). |
| **Type/index maps** (`index_parser_map_`) | Mutated by `AddIncomingType()` and read by `Parse()` / `ParseSharedMemoryRecord()`, but both are called exclusively from `SourceSession::Tick()`, which runs single-threaded per session. |

If the design ever evolves to allow concurrent access to a `LogParser`
(e.g. parallel readers or writers from different threads), `index_parser_map_`
would need protection (e.g. `std::shared_mutex`).

## Configuration

Configure logging to match application requirements through static configuration during application deployment. Deploy the configuration file relative to the binary under the `etc` directory (e.g., `./etc/logging.json`).
Expand Down
6 changes: 5 additions & 1 deletion score/datarouter/build_configuration_flags/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ config_setting(
":persistent_logging": "True",
},
visibility = [
"//platform/aas/test/pas/datarouterconf:__subpackages__",
"//platform/aas/pas/datarouterconf:__subpackages__",
"@score_logging//score/datarouter:__subpackages__",
],
)
Expand Down Expand Up @@ -108,4 +108,8 @@ bool_flag(
config_setting(
name = "enable_local_vlan",
flag_values = {":use_local_vlan": "True"},
visibility = [
"//score/datarouter/network:__pkg__",
# "@xyz//score/datarouter/network:__pkg__",
],
)
36 changes: 18 additions & 18 deletions score/datarouter/datarouter/data_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include "score/datarouter/datarouter/data_router.h"

#include "logparser/logparser.h"

#include "score/mw/log/logging.h"

#include "score/os/unistd.h"
Expand Down Expand Up @@ -74,8 +76,8 @@ std::string QuotaValueAsString(double quota) noexcept
return ss.str();
}

DataRouter::DataRouter(score::mw::log::Logger& logger, SourceSetupCallback source_callback)
: stats_logger_(logger), source_callback_(source_callback)
DataRouter::DataRouter(score::mw::log::Logger& logger, std::unique_ptr<ILogParserFactory> log_parser_factory)
: stats_logger_(logger), log_parser_factory_(std::move(log_parser_factory))
{
}

Expand Down Expand Up @@ -122,16 +124,18 @@ std::unique_ptr<DataRouter::SourceSession> DataRouter::NewSourceSessionImpl(
std::unique_ptr<score::mw::log::detail::ISharedMemoryReader> reader,
const score::mw::log::NvConfig& nv_config)
{
auto source_session =
std::make_unique<DataRouter::SourceSession>(*this,
std::move(reader),
name,
is_dlt_enabled,
std::move(handle),
quota,
quota_enforcement_enabled,
stats_logger_,
std::make_unique<score::platform::internal::LogParser>(nv_config));
auto parser = log_parser_factory_ ? log_parser_factory_->Create(nv_config)
: std::make_unique<score::platform::internal::LogParser>(nv_config);

auto source_session = std::make_unique<DataRouter::SourceSession>(*this,
std::move(reader),
name,
is_dlt_enabled,
std::move(handle),
quota,
quota_enforcement_enabled,
stats_logger_,
std::move(parser));

if (!source_session)
{
Expand All @@ -145,10 +149,6 @@ std::unique_ptr<DataRouter::SourceSession> DataRouter::NewSourceSessionImpl(
// from new_source_session_impl() which acquires the lock before construction.
std::ignore = sources_.insert(source_session.get());

if (source_callback_)
{
source_callback_(std::move(source_session->GetParser()));
}
// persistent subscribers
return source_session;
}
Expand Down Expand Up @@ -237,7 +237,7 @@ void DataRouter::SourceSession::ProcessAndRouteLogMessages(uint64_t& message_cou
}

auto record_received_timestamp = score::mw::log::detail::TimePoint::clock::now();
parser_->Parse(record);
parser_->ParseSharedMemoryRecord(record);
++message_count_local;

transport_delay_local = std::max(transport_delay_local,
Expand Down Expand Up @@ -307,7 +307,7 @@ void DataRouter::SourceSession::ProcessDetachedLogs(uint64_t& number_of_bytes_in
parser_->AddIncomingType(registration);
},
[this](const auto& record) noexcept {
parser_->Parse(record);
parser_->ParseSharedMemoryRecord(record);
});

if (number_of_bytes_in_buffer_result_detached.has_value())
Expand Down
18 changes: 9 additions & 9 deletions score/datarouter/datarouter/data_router.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#define SCORE_DATAROUTER_DATAROUTER_DATA_ROUTER_H

#include "daemon/message_passing_server.h"
#include "logparser/logparser.h"
#include "logparser/i_log_parser_factory.h"
#include "score/mw/log/configuration/nvconfig.h"
#include "score/mw/log/detail/data_router/shared_memory/reader_factory.h"
#include "score/mw/log/detail/data_router/shared_memory/shared_memory_reader.h"
#include "score/datarouter/daemon_communication/session_handle_interface.h"
#include "unix_domain/unix_domain_server.h"

#include "score/concurrency/synchronized.h"
#include "score/mw/log/logger.h"
#include "score/datarouter/lib/synchronized/synchronized.h"

#include "score/variant.hpp"

Expand All @@ -40,9 +40,13 @@ namespace datarouter
{

using internal::ILogParser;
using internal::ILogParserFactory;
using internal::MessagePassingServer;
using internal::UnixDomainServer;

template <typename T, typename Mutex = std::mutex>
using Synchronized = score::concurrency::Synchronized<T, Mutex>;

std::string QuotaValueAsString(double quota) noexcept;

struct LocalSubscriberData
Expand Down Expand Up @@ -84,14 +88,13 @@ struct StatsData
class DataRouter
{
public:
using SourceSetupCallback = std::function<void(ILogParser&&)>;
using SessionPtr = std::unique_ptr<UnixDomainServer::ISession>;
using MessagingSessionPtr = std::unique_ptr<MessagePassingServer::ISession>;

using SessionHandleVariant = score::cpp::variant<UnixDomainServer::SessionHandle,
score::cpp::pmr::unique_ptr<score::platform::internal::daemon::ISessionHandle>>;

explicit DataRouter(score::mw::log::Logger& logger, SourceSetupCallback source_callback = SourceSetupCallback());
explicit DataRouter(score::mw::log::Logger& logger, std::unique_ptr<ILogParserFactory> log_parser_factory = nullptr);

MessagingSessionPtr NewSourceSession(
int fd,
Expand All @@ -105,17 +108,14 @@ class DataRouter
score::mw::log::detail::ReaderFactoryPtr reader_factory =
score::mw::log::detail::ReaderFactory::Default(score::cpp::pmr::get_default_resource()));

template <typename E, typename F>
void ForEachSourceParser(E e, F f, bool enable_logging_client)
void ForEachSource(bool enable_logging_client)
{
std::lock_guard<std::mutex> lock(subscriber_mutex_);
for (const auto& source_session : sources_)
{
// No need for the extra lock - synchronization is handled by the Synchronized<T> wrapper
source_session->SetLoggingClientEnabled(enable_logging_client);
e(source_session->GetParser());
}
f();
}

void ShowSourceStatistics(uint16_t series_num);
Expand Down Expand Up @@ -214,7 +214,7 @@ class DataRouter
score::mw::log::Logger& stats_logger_;

std::unordered_set<SourceSession*> sources_;
SourceSetupCallback source_callback_;
std::unique_ptr<ILogParserFactory> log_parser_factory_;

std::mutex subscriber_mutex_;
};
Expand Down
1 change: 1 addition & 0 deletions score/datarouter/dlt_filetransfer_trigger_lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ cc_library(
],
deps = [
"filetransfer_message_types",
"//score/mw/log/legacy_non_verbose_api",
"@score_logging//score/datarouter:log",
],
)
Expand Down
Loading
Loading