Skip to content

RDKEMW-20646 : Using Thread::WorkerPool to send the events#322

Open
karuna2git wants to merge 1 commit into
developfrom
topic/RDKEMW-20646-2
Open

RDKEMW-20646 : Using Thread::WorkerPool to send the events#322
karuna2git wants to merge 1 commit into
developfrom
topic/RDKEMW-20646-2

Conversation

@karuna2git

Copy link
Copy Markdown
Contributor

Reason for change: All the NetworkManager Events are published from the calling thread context; somethings are from NMEvent, NMThread, somethings are from Connectivity thread and WiFiQualityMonitoring thread. When consumer is not responding properly, this will lead to extended lock & Sometimes Gnome NetworkManager Crash. To avoid this, all the events are sent thro Thread::WorkerPool that is default created by the Thunder. Test Procedure: Verify All the Networking Events
Risks: Medium
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com

Copilot AI review requested due to automatic review settings July 6, 2026 21:09
@karuna2git karuna2git requested a review from a team as a code owner July 6, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent NetworkManager event publishing from blocking (and potentially deadlocking/crashing) caller threads by offloading notification delivery onto Thunder’s default Core::IWorkerPool.

Changes:

  • Introduces a worker-pool based event dispatch path (dispatchEvent + Job) and routes existing NetworkManager notifications through it.
  • Updates plugin/legacy .conf.in templates to use new CMake-configurable *_AUTOSTART values and removes legacy .config templates.
  • Updates the unified plugin targets to build with CXX_STANDARD 17.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
plugin/NetworkManagerImplementation.h Adds NMPublishEvents, Job dispatch wrapper, and private dispatch helpers.
plugin/NetworkManagerImplementation.cpp Routes notification callbacks through worker pool; adds Dispatch switch-based fanout and adds LOG_ENTRY_FUNCTION() in multiple methods.
plugin/NetworkManager.config Removed legacy plugin .config template.
plugin/NetworkManager.conf.in Makes autostart configurable via @PLUGIN_NETWORKMANAGER_AUTOSTART@.
plugin/CMakeLists.txt Adds PLUGIN_NETWORKMANAGER_AUTOSTART cache var; bumps unified plugin targets to C++17.
legacy/LegacyWiFiManagerAPIs.config Removed legacy plugin .config template.
legacy/LegacyWiFiManagerAPIs.conf.in Makes autostart configurable via @PLUGIN_LEGACY_WIFI_AUTOSTART@.
legacy/LegacyNetworkAPIs.config Removed legacy plugin .config template.
legacy/LegacyNetworkAPIs.conf.in Makes autostart configurable via @PLUGIN_LEGACY_NW_AUTOSTART@.
legacy/CMakeLists.txt Adds PLUGIN_LEGACY_*_AUTOSTART cache vars.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.cpp Outdated
Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.h Outdated
Comment thread plugin/NetworkManagerImplementation.h Outdated
Comment thread plugin/CMakeLists.txt
@karuna2git karuna2git force-pushed the topic/RDKEMW-20646-2 branch from dacaa00 to e0b4654 Compare July 6, 2026 21:22
Copilot AI review requested due to automatic review settings July 6, 2026 21:32
@karuna2git karuna2git force-pushed the topic/RDKEMW-20646-2 branch from e0b4654 to 98e1a45 Compare July 6, 2026 21:32
@karuna2git karuna2git force-pushed the topic/RDKEMW-20646-2 branch from 98e1a45 to 8111fe9 Compare July 6, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/NetworkManagerImplementation.h Outdated
Comment thread plugin/NetworkManagerImplementation.h Outdated
Comment thread plugin/CMakeLists.txt
Comment thread plugin/NetworkManager.conf.in
Copilot AI review requested due to automatic review settings July 6, 2026 21:37
Reason for change: All the NetworkManager Events are published from the calling thread context; somethings are from NMEvent, NMThread, somethings are from Connectivity thread and WiFiQualityMonitoring thread. When consumer is not responding properly, this will lead to extended lock & Sometimes Gnome NetworkManager Crash.
To avoid this, all the events are sent thro Thread::WorkerPool that is default created by the Thunder.
Test Procedure: Verify All the Networking Events
Risks: Medium
Signed-off-by: Karunakaran A <karunakaran_amirthalingam@cable.comcast.com
@karuna2git karuna2git force-pushed the topic/RDKEMW-20646-2 branch from 8111fe9 to ebc2f9b Compare July 6, 2026 21:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Comment on lines +222 to +226
class EXTERNAL Job : public Core::IDispatch {
protected:
Job(NetworkManagerImplementation *pNWImpl , NMPublishEvents event, JsonObject &params)
: m_jobNWImpl(pNWImpl)
, _event(event)
Comment on lines +1013 to 1017
{
JsonObject parameters;
parameters.FromString(jsonOfFilterScanResults);
dispatchEvent(NM_ON_AVAILABLESSIDS, parameters);
}
Comment on lines +747 to +756
case NM_ON_AVAILABLESSIDS:
{
string jsonOfFilterScanResults;
parameters.ToString(jsonOfFilterScanResults);
for (const auto callback : callbacks) {
callback->onAvailableSSIDs(jsonOfFilterScanResults);
callback->Release();
}
}
break;
void NetworkManagerImplementation::Dispatch(NMPublishEvents event, const JsonObject &parameters)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO("Posting %d Event\n", event);
Copilot AI review requested due to automatic review settings July 6, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Comment on lines +1013 to 1017
{
JsonObject parameters;
parameters.FromString(jsonOfFilterScanResults);
dispatchEvent(NM_ON_AVAILABLESSIDS, parameters);
}
Comment on lines +749 to +754
string jsonOfFilterScanResults;
parameters.ToString(jsonOfFilterScanResults);
for (const auto callback : callbacks) {
callback->onAvailableSSIDs(jsonOfFilterScanResults);
callback->Release();
}
Comment on lines +222 to +225
class EXTERNAL Job : public Core::IDispatch {
protected:
Job(NetworkManagerImplementation *pNWImpl , NMPublishEvents event, const JsonObject &params)
: m_jobNWImpl(pNWImpl)
Comment thread plugin/CMakeLists.txt
Comment on lines 74 to 77
set_target_properties(${MODULE_NAME} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE)
Comment thread plugin/CMakeLists.txt
Comment on lines 131 to 134
set_target_properties(${MODULE_IMPL_NAME} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants