RDKEMW-20574 : Fix the notification locks in networkmanager plugin#319
Open
jincysam87 wants to merge 7 commits into
Open
RDKEMW-20574 : Fix the notification locks in networkmanager plugin#319jincysam87 wants to merge 7 commits into
jincysam87 wants to merge 7 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.
Comment on lines
+865
to
+867
| _filterVectorsLock.Lock(); | ||
| filterScanResults(filterResult); | ||
| _filterVectorsLock.Unlock(); |
Comment on lines
618
to
+623
| string ssid = object["ssid"].String(); | ||
| 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
+623
to
629
| bool freqMatches = filterFrequencies.empty(); | ||
| 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: jincysaramma_sam@comcast.com