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

api/seal-status: fix deadlock when namespace is set on seal-status calls #23861

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

jasonodonnell
Copy link
Contributor

PR #10725 introduced a change to support namespaces in vault status requests but introduced a deadlock on calls to sys/seal-status when namespaces are included.

When requests have a namespace configured the handler routes the request through switchedLockHandleRequest and holds the read statelock for the duration of the request:

if doLocking {
c.stateLock.RLock()
defer c.stateLock.RUnlock()
}
.

I've added a locking arg so the caller can decide if the statelock needs to be grabbed or not.

@jasonodonnell jasonodonnell added this to the 1.15.2 milestone Oct 26, 2023
@jasonodonnell jasonodonnell requested a review from a team October 26, 2023 17:25
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Oct 26, 2023
@github-actions
Copy link

Build Results:
All builds succeeded! ✅

@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

@jasonodonnell jasonodonnell requested review from a team and removed request for a team October 26, 2023 19:12
Copy link
Contributor

@raskchanky raskchanky left a comment

Choose a reason for hiding this comment

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

@jasonodonnell jasonodonnell merged commit 29d8929 into main Oct 27, 2023
@jasonodonnell jasonodonnell deleted the seal-status-deadlock branch October 27, 2023 13:59
jasonodonnell added a commit that referenced this pull request Oct 27, 2023
…lls (#23861)

* api/seal-status: fix deadlock when namespace is set on seal-status calls

* changelog
jasonodonnell added a commit that referenced this pull request Oct 27, 2023
…lls (#23861)

* api/seal-status: fix deadlock when namespace is set on seal-status calls

* changelog
jasonodonnell added a commit that referenced this pull request Oct 27, 2023
…lls (#23861)

* api/seal-status: fix deadlock when namespace is set on seal-status calls

* changelog
jasonodonnell added a commit that referenced this pull request Oct 27, 2023
…lls (#23861) (#23879)

* api/seal-status: fix deadlock when namespace is set on seal-status calls

* changelog

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
jasonodonnell added a commit that referenced this pull request Oct 27, 2023
…lls (#23861) (#23881)

* api/seal-status: fix deadlock when namespace is set on seal-status calls

* changelog

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
jasonodonnell added a commit that referenced this pull request Oct 27, 2023
…al-status calls into release/1.13.x (#23877)

* api/seal-status: fix deadlock when namespace is set on seal-status calls (#23861)

* api/seal-status: fix deadlock when namespace is set on seal-status calls

* changelog

* oops

* Fix seal type

---------

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants