RDKEMW-20574 : Fix the notification locks in networkmanager plugin#319
Open
jincysam87 wants to merge 13 commits into
Open
RDKEMW-20574 : Fix the notification locks in networkmanager plugin#319jincysam87 wants to merge 13 commits into
jincysam87 wants to merge 13 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses lock-related issues in the NetworkManager plugin by tightening the scope of notification callback locking and adding a dedicated lock for WiFi scan filter vectors to prevent concurrent access problems during scan option updates and scan result filtering.
Changes:
- Narrow
_notificationLockscope so it’s held primarily during notification callback iteration rather than across additional work/telemetry logging. - Introduce
_filterVectorsLockto protectm_filterSsidslist/m_filterFrequenciesduring updates and filtering. - In the GNOME backend, snapshot the SSID filter vector before issuing a scan request to avoid races with later modifications.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugin/rdk/NetworkManagerRDKProxy.cpp | Adds locking around updates to WiFi scan filter vectors for the RDK backend. |
| plugin/NetworkManagerImplementation.h | Introduces _filterVectorsLock to protect shared filter vectors. |
| plugin/NetworkManagerImplementation.cpp | Adjusts notification lock scope and adds filter-vector locking around scan result filtering. |
| plugin/gnome/NetworkManagerGnomeProxy.cpp | Adds locking for filter vector updates and uses an SSID snapshot for scan requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
karuna2git
previously approved these changes
Jun 30, 2026
| #define NMLOG_FATAL(FMT, ...) logPrint(NetworkManagerLogger::FATAL_LEVEL, __FILE__,__func__, __LINE__, FMT, ##__VA_ARGS__) | ||
|
|
||
| #define LOG_ENTRY_FUNCTION() { NMLOG_DEBUG("Entering"); } | ||
| #define LOG_ENTRY_FUNCTION() { NMLOG_INFO("Entering %s", __func__); } |
Comment on lines
619
to
+623
| string frequency = object["frequency"].String(); | ||
|
|
||
| double frequencyValue = std::stod(frequency); | ||
| bool ssidMatches = scanForSsidsSet.empty() || scanForSsidsSet.find(ssid) != scanForSsidsSet.end(); | ||
| bool freqMatches = m_filterFrequencies.empty(); | ||
| bool freqMatches = filterFrequencies.empty(); |
Comment on lines
+813
to
+819
| m_filterVectorsLock.Lock(); | ||
| // Replace existing stored filters only after successful parsing/validation. | ||
| m_filterSsidslist.clear(); | ||
| m_filterFrequencies.clear(); | ||
| m_filterSsidslist = filteredSsids; | ||
| m_filterFrequencies = filteredFrequencies; | ||
| m_filterVectorsLock.Unlock(); |
Comment on lines
975
to
+998
| @@ -994,6 +995,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN+1] = { | |||
| NMLOG_DEBUG("%s added to Frequency filtering", frequencyList.c_str()); | |||
| } | |||
| } | |||
| m_filterVectorsLock.Unlock(); | |||
Comment on lines
624
to
629
| if (!freqMatches) | ||
| { | ||
| for (const auto& selectedFrequency : m_filterFrequencies) | ||
| for (const auto& selectedFrequency : filterFrequencies) | ||
| { | ||
| if (selectedFrequency == "ALL") | ||
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change: Fix the notification locks in networkmanager plugin
Priority: P1
Test Procedure: Check the test steps in RDKEMW-20574
Risks: medium
Signed-off-by: [email protected]