Skip to content

RDKEMW-23908: Reduce default ping count from 3 to 1 and timeout from 3s to 1s - #345

Open
tukken-comcast wants to merge 1 commit into
developfrom
topic/RDKEMW-23908
Open

RDKEMW-23908: Reduce default ping count from 3 to 1 and timeout from 3s to 1s#345
tukken-comcast wants to merge 1 commit into
developfrom
topic/RDKEMW-23908

Conversation

@tukken-comcast

Copy link
Copy Markdown
Contributor

Reason for change: Current Ping method is synchronous and blocks other method calls while ping is executing. This fix is a mitigation. A proper fix requires methods like Ping that trigger long-running operations to be asynchronous.
Test Procedure: Refer ticket
Risks: Low
Signed-off-by: Tony_Ukken2@comcast.com

Copilot AI lite review requested due to automatic review settings August 27, 2026 17:21
@tukken-comcast
tukken-comcast requested a review from a team as a code owner August 27, 2026 17: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.

Pull request overview

Mitigates JSON-RPC Ping being a synchronous/blocking call by reducing its default work (fewer packets, shorter timeout), and updates API documentation/schema to reflect the new default request count.

Changes:

  • Reduced Ping default request count from 3 to 1 in the JSON-RPC implementation.
  • Reduced Ping default timeout from 3s to 1s in the JSON-RPC implementation.
  • Updated API docs/schema to reflect the new default count value.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
plugin/NetworkManagerJsonRpc.cpp Updates JSON-RPC Ping defaults (count/timeout) to reduce blocking duration.
docs/NetworkManagerPlugin.md Updates Ping parameter docs (default count), but currently omits the new default timeout.
definition/NetworkManager.json Updates count definition summary default, but timeout definition remains generic despite Ping default change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +886 to 887
| params?.count | integer | <sup>*(optional)*</sup> The number of requests to send. Default is 1 |
| params?.timeout | integer | <sup>*(optional)*</sup> Timeout |
Comment on lines +95 to 97
"summary": "The number of requests to send. Default is 1.",
"type": "integer",
"example": 10
Comment thread plugin/NetworkManagerJsonRpc.cpp

@karuna2git karuna2git 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.

Change the legacyNetwork.cpp also for the defaults

Copilot AI review requested due to automatic review settings August 28, 2026 10:42

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

docs/NetworkManagerPlugin.md:887

  • The Ping parameter table updates the default count to 1, but the PR also changes the default timeout to 1s; the timeout row currently doesn’t document the new default or the unit (seconds), which can confuse API consumers.
| params?.count | integer | <sup>*(optional)*</sup> The number of requests to send. Default is 1 |
| params?.timeout | integer | <sup>*(optional)*</sup> Timeout |

…erval (0.2s->0.002s)

Reason for change: Current Ping method is synchronous and blocks other method
calls while ping is executing. This fix is a mitigation. A proper fix requires
methods like Ping that trigger long-running operations to be asynchronous.
Test Procedure: Refer ticket
Risks: Low
Signed-off-by: Tony_Ukken2@comcast.com
Copilot AI review requested due to automatic review settings August 31, 2026 07:14

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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

plugin/NetworkManagerImplementation.cpp:458

  • ping/ping6 interval was changed from 0.2s to 0.002s. On common iputils builds, intervals <0.2s are treated as “flood” and require elevated privileges (or special sysctls), so this can cause Ping to fail for non-privileged service users when callers pass count>1. Keeping the previous 0.2s avoids a runtime failure while still allowing the reduced default count/timeout to mitigate blocking.
                snprintf(cmd, sizeof(cmd), "ping  -c %d -W %d -i 0.002 '%s' 2>&1", noOfRequest, timeOutInSeconds, endpoint.c_str());

if(0 == strcasecmp("IPv6", ipversion.c_str()))
{
snprintf(cmd, sizeof(cmd), "ping6 -c %d -W %d -i 0.2 '%s' 2>&1", noOfRequest, timeOutInSeconds, endpoint.c_str());
snprintf(cmd, sizeof(cmd), "ping6 -c %d -W %d -i 0.002 '%s' 2>&1", noOfRequest, timeOutInSeconds, endpoint.c_str());
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