Fix deadlock on the mounts & auth locks (#6560)

* Fix deadlock on the mountsLock

* Fix deadlock on authLock too
This commit is contained in:
Brian Kassouf 2019-04-09 19:20:06 -07:00 committed by GitHub
parent 673dcfe49f
commit 76969aa801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -2913,6 +2913,7 @@ func (b *SystemBackend) pathInternalUIMountsRead(ctx context.Context, req *logic
for _, entry := range b.Core.mounts.Entries {
filtered, err := b.Core.checkReplicatedFiltering(ctx, entry, "")
if err != nil {
b.Core.mountsLock.RUnlock()
return nil, err
}
if filtered {
@ -2938,6 +2939,7 @@ func (b *SystemBackend) pathInternalUIMountsRead(ctx context.Context, req *logic
for _, entry := range b.Core.auth.Entries {
filtered, err := b.Core.checkReplicatedFiltering(ctx, entry, credentialRoutePrefix)
if err != nil {
b.Core.authLock.RUnlock()
return nil, err
}
if filtered {