Skip to content

RDKB-63856 Fix leaks in BPI#13

Merged
gsathish86 merged 5 commits intordkcentral:developfrom
pavithrasundaravadivel:DEV_fix_bpi_stop
Mar 11, 2026
Merged

RDKB-63856 Fix leaks in BPI#13
gsathish86 merged 5 commits intordkcentral:developfrom
pavithrasundaravadivel:DEV_fix_bpi_stop

Conversation

@pavithrasundaravadivel
Copy link
Copy Markdown
Contributor

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

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
Copilot AI review requested due to automatic review settings March 10, 2026 07:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 stop command on additional failure paths in Ethernet LAN client workflows.
  • Ensure leave_namespace() is called after each HTTP endpoint handler and after svr.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 invoking test_stop(), so steps aren’t removed and the object remains subscribed in the message manager. Ensure cleanup/unsubscribe happens before pthread_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 gsathish86 merged commit 6463955 into rdkcentral:develop Mar 11, 2026
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants