Skip to content

RDKEMW-26210: Workstream A implementation of Coarselock proposal - #649

Open
trupthi1403 wants to merge 2 commits into
masterfrom
feature/RDKEMW-26210-dev
Open

trupthi1403 wants to merge 2 commits into
masterfrom
feature/RDKEMW-26210-dev

Conversation

@trupthi1403

Copy link
Copy Markdown
Contributor

RDKEMW-26210: Workstream A implementation of Coarselock proposal

Reason for change: reduce IPC lock contention by making socket state atomic, splitting pending-call locking
Test Procedure: UT/CT, Fullstack

…arseLock

Summary: reduce IPC lock contention by making socket state atomic, splitting pending-call locking, moving send paths out of global locks, and adding concurrent no-reply coverage
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: RDKEMW-26210
Copilot AI balanced review requested due to automatic review settings October 19, 2026 12:22
@github-actions

Copy link
Copy Markdown

Pull request title must follow the pattern:
< JIRA TICKET >: < one line summary of change less than 65 characters >

Pull request description must follow the Commit message format for RDK-E:
https://etwiki.sys.comcast.net/spaces/RDKAR/pages/1407997180/Commit+Message+Format+For+RDKE

  1. Associated JIRA ticket in format : < JIRA TICKET >: < one line summary of change less than 65 characters >
  2. Detailed reason for change information
  3. Test procedure. Only references links to Jira ticket or sub tickets where test steps and references are captured.

< JIRA TICKET >: < one line summary of change less than 65 characters >
< empty line >
Reason for change:
Test Procedure: < https://ccp.sys.comcast.net/browse/JIRA TICKET/url/to/test_step_section>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved socket-lifetime, receive-buffer, and callback-completion races can cause misdirected traffic, data corruption, and use-after-free.

6 open issues
What changed in this PR

Implements Workstream A to reduce IPC lock contention in client channels and server connections.

Changes:

  • Makes socket state atomic and separates pending-call locking.
  • Moves receive buffers to individual channels and narrows server lock scopes.
  • Adds concurrent no-reply request coverage.
File Description
tests/​unittests/​ipc/​IpcTest.cpp Adds multithreaded no-reply request test.
ipc/​server/​source/​IpcServerImpl.h Makes client socket descriptors atomic.
ipc/​server/​source/​IpcServerImpl.cpp Updates socket lifecycle handling and send locking.
ipc/​client/​source/​IpcChannelImpl.h Separates pending-call locking and adds per-channel buffers.
ipc/​client/​source/​IpcChannelImpl.cpp Refactors socket access, receiving, and pending-call registration.

Review effort: Balanced

Comment thread ipc/client/source/IpcChannelImpl.cpp
Comment thread ipc/client/source/IpcChannelImpl.cpp Outdated
Comment thread ipc/client/source/IpcChannelImpl.cpp Outdated
Comment thread ipc/server/source/IpcServerImpl.cpp Outdated
Comment thread ipc/client/source/IpcChannelImpl.cpp Outdated
Comment thread tests/unittests/ipc/IpcTest.cpp
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.5%
Functions coverage stays unchanged and is: 92.8%

Comment thread ipc/client/source/IpcChannelImpl.cpp Fixed
Comment thread ipc/server/source/IpcServerImpl.cpp Fixed
Copilot AI balanced review requested due to automatic review settings October 19, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread ipc/client/source/IpcChannelImpl.cpp Outdated
Comment thread ipc/client/source/IpcChannelImpl.cpp Outdated
Comment thread ipc/client/source/IpcChannelImpl.cpp Outdated
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.5%
Functions coverage stays unchanged and is: 92.8%

Copilot AI balanced review requested due to automatic review settings October 19, 2026 15:24
@trupthi1403
trupthi1403 force-pushed the feature/RDKEMW-26210-dev branch from 3cf4445 to 71a9147 Compare October 19, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Concurrent receive processing can discard a valid reply when another thread handles socket closure.

2 open issues
2 resolved since last review

Review effort: Balanced

Comment thread ipc/client/source/IpcChannelImpl.cpp Outdated
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.5%
Functions coverage stays unchanged and is: 92.8%

Copilot AI balanced review requested due to automatic review settings October 19, 2026 16:03
@trupthi1403
trupthi1403 force-pushed the feature/RDKEMW-26210-dev branch from 71a9147 to b28af94 Compare October 19, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Scheduling-dependent test failures, added logging overhead, and missing concurrent reply-path coverage remain unresolved.

5 open issues
1 resolved since last review

Review effort: Balanced

// copy in the actual message data
std::string reqString = request->SerializeAsString();
call->set_request_message(std::move(reqString));
const std::string kRequestDebugString = request->ShortDebugString();
Comment on lines +1183 to +1187
MethodCall pendingCall = methodCall;
pendingCall.timeoutDeadline = std::chrono::steady_clock::time_point::max();

if (m_sock < 0)
{
errorMessage = "Not connected";
}
else if (sendmsg(m_sock, header, MSG_NOSIGNAL) != static_cast<ssize_t>(kRequiredDataLen))
std::lock_guard<std::mutex> locker(m_lock);
m_methodCalls.emplace(kSerialId, pendingCall);
Comment thread ipc/server/source/IpcServerImpl.cpp
Comment on lines +296 to +300
for (int i = 0; i < kRequestsPerThread; ++i)
{
if (!m_clientStub->sendSingleVarRequestWithNoReply(m_int))
{
allRequestsSucceeded.store(false, std::memory_order_relaxed);
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.5%
Functions coverage stays unchanged and is: 92.8%

Copilot AI balanced review requested due to automatic review settings October 20, 2026 05:52
@trupthi1403
trupthi1403 force-pushed the feature/RDKEMW-26210-dev branch from b28af94 to fcea6da Compare October 20, 2026 05:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.5%
Functions coverage stays unchanged and is: 92.8%

Copilot AI balanced review requested due to automatic review settings October 20, 2026 08:16
@trupthi1403
trupthi1403 force-pushed the feature/RDKEMW-26210-dev branch from fcea6da to 2de867e Compare October 20, 2026 08:16
@trupthi1403
trupthi1403 force-pushed the feature/RDKEMW-26210-dev branch from 2de867e to ea109cd Compare October 20, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The concurrency-sensitive socket and pending-call lifecycle changes require human validation before approval.

3 open issues
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 20, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Performance regressions and missing concurrent reply-path coverage remain unresolved.

3 open issues

Review effort: Balanced

@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.5%
Functions coverage stays unchanged and is: 92.8%

1 similar comment
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.5%
Functions coverage stays unchanged and is: 92.8%

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants