spring-projects / spring-projects/spring-security
SEC-3157: deleteEntries in updateAcl causing deadlocks with concurrent updates
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Eric Henry (Migrated from SEC-3157) said:
When running project integration tests concurrently, I'm seeing a lot of DeadlockLoserDataAccessExceptions. After a good amount of research I came across this StackOverflow answer.
Using the JdbcMutableAclService.createAcl(ObjectIdentity) method is the only way to create and ACL, but it doesn't create ACEs at the same time. In order to persist the ACEs you have to call JdbcMutableAclService.updateAcl(MutableAcl). One of the first things the updateAcl method does is delete entries. Since there are no ACEs yet we end up in the situation described by the StackOverflow answer listed above. I have included some information from MySQL that I used to research the issue.
I created a pull request on GitHub, but I need to write a test that reproduces the issue (I have done this with in my project environment, just not for the Spring Security project)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with JdbcMutableAclService.createAcl(ObjectIdentity) and updateAcl(MutableAcl), focusing on the delete-entries step described in the report and the supplied MySQL deadlock information. Reproduce concurrent ACL creation and updates in a Spring Security integration test; done means the test demonstrates the issue and verifies the corrected behavior without deadlocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mysql, spring
- Domain
- authorization, database, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100