Skip to content

Fix leak of serialized p4info in RPC server state sync - #681

Open
Devansh-567 wants to merge 2 commits into
p4lang:mainfrom
Devansh-567:fix-rpc-server-state-sync
Open

Devansh-567 wants to merge 2 commits into
p4lang:mainfrom
Devansh-567:fix-rpc-server-state-sync

Conversation

@Devansh-567

@Devansh-567 Devansh-567 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

summary

this change fixes a memory leak in rpc server state synchronization by freeing the serialized p4info data for each device before releasing the device array. adds a regression test to verify state synchronization when devices are assigned.

description

during rpc server initialization, the serialized p4info data for assigned devices was not freed before the temporary device array was released. this could cause memory leaks when synchronizing device state. this change frees the serialized config for each device and adds a test that checks initialization with no assigned devices, device assignment, and state synchronization for a newly connected client.

scope

  • free serialized p4info data for each device during rpc server initialization
  • add a dedicated rpc server test target
  • add a state synchronization regression test using nanomsg
  • verify that a new client receives the current device state and valid p4info config

testting

added a regression test for rpc server state synchronization, including device assignment and retrieval of the current device state by a new client. test execution remains to be verified.

Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>
@jafingerhut

Copy link
Copy Markdown
Contributor

@Devansh-567 Looks like there are conflicts with the proposed changes here, relative to some other PR(s) that were recently merged.

Signed-off-by: Devansh Singh <devansh.jay.singh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants