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.17](backport #6927) Fix deadlock in error handling in OTelManager #6954

Closed
wants to merge 1 commit into from

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
Copy link
Contributor Author

mergify bot commented Feb 20, 2025

Cherry-pick of 9b572ef has failed:

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

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/rm <file>..." as appropriate to mark resolution)
	deleted by us:   internal/pkg/otel/manager/manager.go
	deleted by us:   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

@mergify mergify bot requested review from michel-laterman and swiatekm and removed request for a team February 20, 2025 18:31
@blakerouse
Copy link
Contributor

Too far back. I didn't know it included this far back in the backports.

@blakerouse blakerouse closed this Feb 20, 2025
@mergify mergify bot deleted the mergify/bp/8.17/pr-6927 branch February 20, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant