RDKB-63856 Fix leaks in BPI#13
Merged
gsathish86 merged 5 commits intordkcentral:developfrom Mar 11, 2026
Merged
Conversation
Impacted Platforms:
All RDKB Platforms
Reason for change: Closing the FD's proper
once process done.
Test Procedure: Run PR0270 test case and check the
open fd's via proc
Risks: None
Priority: P1
Signed-off-by:Pavithra_Sundaravadivel@comcast.com
There was a problem hiding this comment.
Pull request overview
Fixes external-agent/BPI resource leaks by improving stop/cleanup behavior and ensuring network-namespace transitions are properly unwound in the external agent HTTP server.
Changes:
- Send external-agent
stopcommand on additional failure paths in Ethernet LAN client workflows. - Ensure
leave_namespace()is called after each HTTP endpoint handler and aftersvr.listen()exits. - Adjust external-agent test thread failure handling (removes
test_stop()calls on some fail paths).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/tests/wlan_emu_test_param_eth_lan_client.cpp |
Sends stop command when external agent reports a fail state during timeout processing. |
src/sta/wlan_emu_ext_sta_mgr.cpp |
Sends stop command on multiple error paths during Ethernet LAN device add flow. |
src/external_agent_cci/wlan_ext_emu_tests.cpp |
Removes test_stop() calls in certain early-exit failure paths in the test thread. |
src/external_agent_cci/wlan_ext_emu.cpp |
Adds leave_namespace() calls to avoid namespace FD leaks across HTTP request handling and server lifetime. |
Comments suppressed due to low confidence (1)
src/external_agent_cci/wlan_ext_emu_tests.cpp:321
- Same issue as above: when a step transitions to
wlan_emu_tests_state_cmd_abort, the thread exits without invokingtest_stop(), so steps aren’t removed and the object remains subscribed in the message manager. Ensure cleanup/unsubscribe happens beforepthread_exit()on this error path.
cJSON_free(steps_status_json_str_src);
ext_emu->ext_emu_send_signal_fail();
cJSON_free(agent_status);
pthread_mutex_unlock(&test->m_lock);
pthread_exit(NULL);
return NULL;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
gsathish86
approved these changes
Mar 11, 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.
Impacted Platforms:
All RDKB Platforms
Reason for change: 1. Closing the FD's proper once process done.
2. Sending proper stop command to BPI
Test Procedure: Run PR0270 test case and check the
open fd's via proc command
Risks: None
Priority: P1
Signed-off-by:Pavithra_Sundaravadivel@comcast.com