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

AppRole/Identity: Fix for race when creating an entity during login #3932

Merged
merged 3 commits into from
Feb 9, 2018

Conversation

vishalnayak
Copy link
Member

@vishalnayak vishalnayak commented Feb 7, 2018

Fixes #3746

@vishalnayak vishalnayak added this to the 0.9.4 milestone Feb 7, 2018
@vishalnayak vishalnayak changed the title Possible fix for race in approle login while creating entity AppRole/Identity: Fix for race when creating an entity during login Feb 7, 2018
@@ -258,12 +278,12 @@ func (i *IdentityStore) entityByAliasFactors(mountAccessor, aliasName string, cl
return nil, nil
}

return i.MemDBEntityByAliasID(alias.ID, clone)
return i.MemDBEntityByAliasIDInTxn(txn, alias.ID, clone)
}

// CreateEntity creates a new entity. This is used by core to
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget to update this comment :) Small nit, but I prefer CreateOrFetchEntity.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@vishalnayak vishalnayak merged commit 5bb8fa2 into master Feb 9, 2018
@vishalnayak vishalnayak deleted the approle-race branch February 9, 2018 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants