Skip to content

[9.3] (backport #12225) Report app lock errors correctly#12233

Merged
swiatekm merged 3 commits into9.3from
mergify/bp/9.3/pr-12225
Jan 15, 2026
Merged

[9.3] (backport #12225) Report app lock errors correctly#12233
swiatekm merged 3 commits into9.3from
mergify/bp/9.3/pr-12225

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Jan 13, 2026

What does this PR do?

Ensures we emit the underlying error if we fail to acquire the app lock. Before, we'd erroneously just put nil in there.

Why is it important?

We should always report the underlying error, as it helps with troubleshooting.

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

How to test this PR locally

Run two agents concurrently from the same data directory. You should get:

Error: failed to get app lock: another elastic-agent is already running

Before this change, it's:

Error: failed to get app lock: %!w(<nil>)

This is an automatic backport of pull request #12225 done by [Mergify](https://mergify.com).
If we failed to get the app lock, we wouldn't emit the underlying error.

(cherry picked from commit a44ff92)
@mergify mergify bot requested a review from a team as a code owner January 13, 2026 17:17
@mergify mergify bot added the backport label Jan 13, 2026
@mergify mergify bot requested review from blakerouse and ycombinator and removed request for a team January 13, 2026 17:17
@mergify mergify bot mentioned this pull request Jan 13, 2026
3 tasks
@github-actions github-actions bot added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Jan 13, 2026
@elasticmachine
Copy link
Contributor

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

@swiatekm swiatekm enabled auto-merge (squash) January 14, 2026 15:58
@swiatekm swiatekm merged commit e8f74d7 into 9.3 Jan 15, 2026
22 checks passed
@swiatekm swiatekm deleted the mergify/bp/9.3/pr-12225 branch January 15, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

2 participants