Skip to content

Fix out-of-bounds panic in RTA fetchServices when no PMM agent is found#5136

Closed
Copilot wants to merge 2 commits intoPMM-14900-rta-agent-versionfrom
copilot/sub-pr-5116
Closed

Fix out-of-bounds panic in RTA fetchServices when no PMM agent is found#5136
Copilot wants to merge 2 commits intoPMM-14900-rta-agent-versionfrom
copilot/sub-pr-5116

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

Accessing pmmAgents[0] without a bounds check in fetchServices causes a panic when FindPMMAgentsForService returns an empty slice — a valid scenario for a service with no associated PMM agent.

Changes

  • managed/services/realtimeanalytics/service.go: Added len(pmmAgents) == 0 guard in fetchServices before accessing the first element; services with no PMM agent are silently skipped, consistent with the existing behavior for unsupported agent versions.
if len(pmmAgents) == 0 {
    // skip services without pmm-agent
    return nil
}

if !isPmmAgentSupportRta(pointer.Get(pointer.Get(pmmAgents[0]).Version)) {
    // skip services with unsupported pmm-agent version
    return nil
}

PMM-14900

Link to the Feature Build: SUBMODULES-0

If this PR adds, removes or alters one or more API endpoints, please review and add or update the relevant API documentation as well:

  • API Docs updated

If this PR is related to some other PRs in this or other repositories, please provide links to those PRs:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@it-percona-cla
Copy link
Copy Markdown
Contributor

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: ademidoff <81549+ademidoff@users.noreply.github.com>
Copilot AI changed the title [WIP] [PMM-14900] Address feedback on RTA session protection Fix out-of-bounds panic in RTA fetchServices when no PMM agent is found Mar 12, 2026
@ademidoff ademidoff closed this Mar 12, 2026
@ademidoff ademidoff deleted the copilot/sub-pr-5116 branch March 12, 2026 15:27
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