Skip to content

Sync with main#15

Merged
DouglasAdler merged 4 commits into
latencyfrom
main
Apr 11, 2026
Merged

Sync with main#15
DouglasAdler merged 4 commits into
latencyfrom
main

Conversation

@DouglasAdler
Copy link
Copy Markdown
Contributor

Syncing the latency branch with main

DouglasAdler and others added 4 commits April 4, 2023 09:37
* Test for crash on exit

Signed-off-by: Douglas Adler <douglas.adler@yahoo.com>

* Test for crash on exit

Signed-off-by: Douglas Adler <douglas.adler@yahoo.com>

---------

Signed-off-by: Douglas Adler <douglas.adler@yahoo.com>
Copilot AI review requested due to automatic review settings April 11, 2026 19:51
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

Syncs the latency branch with main by updating RDKPerf module shutdown behavior and adding a CLA GitHub Actions workflow.

Changes:

  • Adjusts PerfModuleTerminate() to stop the timer task earlier, gates report printing on exit behind #if 0, and tweaks timer/thread cleanup.
  • Adds a new .github/workflows/cla.yml reusable-workflow caller to enforce CLA signature checks on PR activity and comments.

Reviewed changes

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

File Description
rdkperf/rdk_perf.cpp Updates termination/shutdown sequence for the timer thread and suppresses report printing on exit.
.github/workflows/cla.yml Introduces a CLA workflow triggered on PR events and issue comments using an external reusable workflow and a PAT secret.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rdkperf/rdk_perf.cpp
Comment on lines +212 to +214
if(s_timer != NULL) {
s_timer->StopTask();
}
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

s_timer->StopTask() writes m_bContinue from a different thread than TimerCallback::Task() reads it, but m_bContinue is a plain bool with no synchronization. This introduces a data race (undefined behavior) on process termination. Consider making m_bContinue an std::atomic<bool> (or guarding reads/writes with the same mutex used for the condition variable) so StopTask/Task communicate safely.

Copilot uses AI. Check for mistakes.
Comment thread rdkperf/rdk_perf.cpp
Comment on lines 229 to +235
if(s_thread != NULL && s_thread->joinable()) {
LOG(eWarning, "Cleaning up timer thread\n");
s_timer->StopTask();
s_thread->join();

delete s_thread;
delete s_timer;
if(s_timer != NULL) delete s_timer;

Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

Timer resource cleanup only happens inside the if (s_thread != NULL && s_thread->joinable()) branch. If s_thread is null / not joinable but s_timer was allocated (e.g., partial init, thread already detached, or future refactor), s_timer will leak. Consider deleting s_timer (and s_thread) independently of joinable() after ensuring the worker is stopped, or handling the else path to free any allocated objects.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/cla.yml

jobs:
CLA-Lite:
name: "Signature"
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

This workflow is triggered by issue_comment and pull_request_target while also passing a PAT secret (CLA_ASSISTANT) into a reusable workflow. In pull_request_target/issue_comment contexts, secrets are available even for forked PRs/comments, which increases the risk of secret exfiltration if the called workflow ever runs untrusted code or responds to attacker-controlled inputs. Consider restricting execution with a job-level if (e.g., only for PR comments, only specific comment commands, and/or only repository members) and minimizing permissions to the least required.

Suggested change
name: "Signature"
name: "Signature"
if: >-
github.event_name == 'pull_request_target' ||
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
(
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'
)
)

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/cla.yml
Comment on lines +6 to +7
actions: write
statuses: write
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The workflow requests broad permissions (actions: write, statuses: write, pull-requests: write). Unless the reusable CLA workflow strictly requires all of these, reduce permissions to least privilege to limit blast radius (especially since this is also triggered by issue_comment/pull_request_target).

Suggested change
actions: write
statuses: write

Copilot uses AI. Check for mistakes.
@DouglasAdler DouglasAdler merged commit 98571a4 into latency Apr 11, 2026
46 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 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.

4 participants