RDKEMW-17125 - Subscribe to NWMgr plugin events from systimemgr#72
Merged
Conversation
- Fix missing WPEFramework includes that caused 'not a namespace-name' and 'JsonObject does not name a type' errors - Move WPEFramework includes exclusively to .cpp to avoid include path issues when header is included from other translation units - Move internal state (controller, thunder_client, m_networkeventsubscribed) to file-scope statics with internal linkage - Convert internal helper functions (subscribeToInternetEvent, unsubscribeFromInternetEvent, plugin_statechange) to static free functions - not part of the class interface - Remove global thunder_ret, use local variable instead - Remove explicit constructor declaration - compiler-generated default is sufficient; destructor handles RAII cleanup on process exit
Two bugs fixed:
1. Use versioned callsign for thunder_client
NETWORK_MANAGER_CALLSIGN ('org.rdk.NetworkManager') was used to
create the LinkType for subscribing to onInternetStatusChange, but
the versioned callsign NETWORK_MANAGER_PLUGIN ('org.rdk.NetworkManager.1')
is required for JSONRPC endpoint resolution. Using the unversioned
callsign caused ERROR_TIMEDOUT (11) on every subscription attempt.
2. Attempt immediate subscription at startup
After subscribing to the controller statechange event, try
subscribeToInternetEvent() immediately. If NetworkManager is already
active when systimemgr starts or restarts, no statechange event is
fired, so the callback-driven subscription never happens. The
immediate attempt handles this case; if it fails (plugin not up yet),
the statechange callback will retry on the next activation.
…ents Add consistent 'CHRONY:' prefix to all RDK_LOG statements in networkstatussrc.cpp for easy log filtering with: grep CHRONY /opt/logs/systimemgr.log Also remove stale debug log that printed internetStatus before it was populated, which always printed an empty string.
Code Coverage Summary |
| * after the last NetworkStatusSrc destructor runs. */ | ||
| NetworkStatusSrc::NetworkStatusSrc() | ||
| { | ||
| sharedState(); /* force initialisation — return value intentionally unused */ |
Contributor
There was a problem hiding this comment.
Coverity Issue - Useless call
Calling "sharedState()" is only useful for its return value, which is ignored.
Medium Impact, CWE-none
USELESS_CALL
Code Coverage Summary |
| * always blocking for the full ACTIVATION_RETRY_INTERVAL_MS. */ | ||
| { | ||
| std::unique_lock<std::mutex> lock(sharedState().mutex); | ||
| sharedState().cv.wait_for(lock, |
Contributor
There was a problem hiding this comment.
Coverity Issue - Data race condition
A wait is performed without a loop. If there is a spurious wakeup, the condition may not be satisfied. [Note: The source code implementation of the function has been overridden by a builtin model.]
Medium Impact, CWE-none
BAD_CHECK_OF_WAIT_COND
How to fix
Check the wait condition in a loop, with the lock held. The lock must not be released between the condition and the wait.
| * after the last NetworkStatusSrc destructor runs. */ | ||
| NetworkStatusSrc::NetworkStatusSrc() | ||
| { | ||
| sharedState(); /* force initialisation — return value intentionally unused */ |
Contributor
There was a problem hiding this comment.
Coverity Issue - Useless call
Calling "sharedState()" is only useful for its return value, which is ignored.
Medium Impact, CWE-none
USELESS_CALL
Code Coverage Summary |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Code Coverage Summary |
1 similar comment
Code Coverage Summary |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Code Coverage Summary |
tdeva14
approved these changes
May 14, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
To manage the Deepsleep and Network Outage events in chronyd, it is essential to monitor the Network Up event, as it is relevant to all network-related events.
Subscribe to the "onInternetStatusChange" event of the NetworkMgr plugin and handle the cases according to the specific requirements.
Test Results available in - https://ccp.sys.comcast.net/browse/RDKEMW-17125