Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.18](backport #6927) Fix deadlock in error handling in OTelManager #6953

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 20, 2025

What does this PR do?

Fixes an issue where a deadlock would cause the the OTelManager to get stuck.

This also seems to be the cause of the flaky test TestOTelManager_Run. I have ran this over 100 times and hit no more errors with this PR.

Why is it important?

Deadlock causes the running internal OTel collector from getting any more updates or actions.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Disruptive User Impact

None

How to test this PR locally

go test -race -v -count=100 github.com/elastic/elastic-agent/internal/pkg/otel/manager

Related issues


This is an automatic backport of pull request #6927 done by [Mergify](https://mergify.com).

* Fix race in error handling.

* Add changelog.

* Add testing.

* Changelog bug-fix.

(cherry picked from commit 9b572ef)

# Conflicts:
#	internal/pkg/otel/manager/manager.go
#	internal/pkg/otel/manager/manager_test.go
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Feb 20, 2025
@mergify mergify bot requested a review from a team as a code owner February 20, 2025 18:31
@mergify mergify bot removed the request for review from a team February 20, 2025 18:31
Copy link
Contributor Author

mergify bot commented Feb 20, 2025

Cherry-pick of 9b572ef has failed:

On branch mergify/bp/8.18/pr-6927
Your branch is up to date with 'origin/8.18'.

You are currently cherry-picking commit 9b572efd2.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1739981369-Fix-deadlock-in-OTelManager.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/otel/manager/manager.go
	both modified:   internal/pkg/otel/manager/manager_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Feb 20, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@blakerouse blakerouse removed the conflicts There is a conflict in the backported pull request label Feb 20, 2025
@blakerouse blakerouse enabled auto-merge (squash) February 20, 2025 20:43
@blakerouse blakerouse merged commit 4358a44 into 8.18 Feb 21, 2025
14 checks passed
@blakerouse blakerouse deleted the mergify/bp/8.18/pr-6927 branch February 21, 2025 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants