You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reason for change: To pause Network Intelligence while speed test is running
Test Procedure: Trigger speed test and confirm if NI pauses on ST_TR181_STATUS_STARTING event
and resumes on ST_TR181_STATUS_COMPLETE event
Risks: Low
Priority: P0
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
It introduces a real exit-status handling bug in the new C handler (unsafe WEXITSTATUS usage), plus security/logging/test coverage issues that should be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds SpeedTest status handling to pause/resume Network Intelligence (cujo-qosd) during SpeedTest runs, wiring an RBUS event into existing AdvSecurity control flows and extending the startup script accordingly.
Changes:
Subscribe to Device.IP.Diagnostics.X_RDKCENTRAL-COM_SpeedTest.Status and handle status transitions to trigger NI pause/resume.
Add -speedtestNIStart / -speedtestNIComplete actions to start_adv_security.sh, including an auto-unpause timer.
Add unit tests validating the new SpeedTest status handler behavior.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved critical and moderate issues affect event ordering, test behavior, and timer/status handling.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (6)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/start_adv_security.sh:623
The timer PID file is never removed when this background timer expires normally. On a later speed-test event, a stale PID can have been reused by an unrelated process, so speedtest_cancel_networkintelligence_timer may send SIGTERM to that process. Clean up the file when the timer exits, but only if it still contains this timer's PID.
scripts/start_adv_security.sh:595
The subscribed status object is Device.IP.Diagnostics.X_RDKCENTRAL-COM_SpeedTest (cosa_adv_security_internal.c:69), but this lookup uses X_RDK_SpeedTest. On devices exposing only the subscribed object, dmcli will return an invalid/non-numeric value and the pause path will exit without disabling cujo-qosd.
This log evaluates WEXITSTATUS(rc) even when the preceding condition is true because WIFEXITED(rc) is false. WEXITSTATUS is only meaningful for a normally exited child, so signal/-1 failures will be logged with a fabricated status; guard the extraction or log the raw return value in that case.
CcspTraceError(("%s: failed to disable cujo-qosd for SpeedTest, rc=%d\n", __FUNCTION__, WEXITSTATUS(rc)));
This log evaluates WEXITSTATUS(rc) even when the preceding condition is true because WIFEXITED(rc) is false. WEXITSTATUS is only meaningful for a normally exited child, so signal/-1 failures will be logged with a fabricated status; guard the extraction or log the raw return value in that case.
CcspTraceError(("%s: failed to enable cujo-qosd for SpeedTest, rc=%d\n", __FUNCTION__, WEXITSTATUS(rc)));
This expectation has the same accessor mismatch: the handler invokes rbusValue_GetUInt32, not rbusValue_GetString. The status-5 test therefore fails on an unexpected mock call before verifying the completion command.
This no-action test also stubs rbusValue_GetString, while the implementation calls rbusValue_GetUInt32; Google Mock will fail on the unexpected accessor instead of exercising the status-2 path.
This deadline is based on CLOCK_REALTIME, which is also the default clock for this condition variable. An NTP or manual wall-clock correction can therefore make the timeout fire early or be postponed indefinitely, enabling qosd while the speed test is still running or leaving it disabled. Use a condition variable configured for CLOCK_MONOTONIC and compute the deadline from that clock.
Because this command is backgrounded, v_secure_system only observes the shell that queued start_adv_security.sh, not the cujo-ni-cli operation performed by the script. A failure to disable qosd therefore usually looks like success here, so the timer is left armed and the speed test can run with qosd still enabled. Run this operation synchronously or add an asynchronous result/retry path before treating the start as successful.
SanthoshGujulvajagadeesh
changed the title
Reason for change:
RDKB-66812, RDKB-66844 : Pause Network Intelligence while speedtest is running
Sep 23, 2026
SanthoshGujulvajagadeesh
changed the title
RDKB-66812, RDKB-66844 : Pause Network Intelligence while speedtest is running
RDKB-66812 RDKB-66844 : Pause Network Intelligence while speedtest is running
Sep 23, 2026
ni_qosd_pause() can return TRUE without issuing a pause when either marker is absent, but this worker always calls ni_qosd_resume() after the wait. If NI is enabled/activated during a speed test that started while it was inactive, this cycle enables QoSD even though it never paused it; conversely, deactivation during a real pause can skip the restore. Capture whether this worker actually paused NI and only resume that state.
When NI is disabled or not activated, this returns TRUE and ni_speedtest_trigger() still leaves a detached worker waiting for the configured timeout (typically 86,400 seconds), even though no pause occurred. If the COMPLETE event is missed and NI is enabled during that interval, later STARTING events are rejected by the running-state check, so NI will not be paused for the new speed test. Skip arming the timer when the feature is inactive, or distinguish a skipped pause from a successful pause so the worker exits immediately.
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
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: To pause Network Intelligence while speed test is running
Test Procedure: Trigger speed test and confirm if NI pauses on ST_TR181_STATUS_STARTING event
and resumes on ST_TR181_STATUS_COMPLETE event
Risks: Low
Priority: P0
Signed-off-by: santhosh_gujulvajagadeesh@comcast.com