-
Bug
-
Resolution: Fixed
-
Low
-
6.9.0
-
None
-
3
-
Severity 3 - Minor
-
Issue Summary
Possible to create duplicate project keys with concurrent Bamboo Specs pushes.
Steps to Reproduce
- Create two Bamboo Specs that reference the same project but create different plans
- Ensure the project does not already exist (so that it is created)
- Push both specs concurrently e.g.
#!/bin/bash cd ~/Documents/bamboo-specs/bamboo-specs/ && mvn -Ppublish-specs & cd ~/Documents/bamboo-specs-2/bamboo-specs && mvn -Ppublish-specs &
- Attempt to browse the project in the UI at Projects >> Project
There may be some variance in reproducibility as this is a race condition.
Expected Results
Only one project is created.
Actual Results
Two projects are created with the same key in PROJECTS table:
project_id | created_date | updated_date | project_key | title | description | marked_for_deletion | oid |
---|---|---|---|---|---|---|---|
218759169 | 2019-09-04 11:58:32 | 2019-09-04 11:58:32 | PKEY | TITLE | false | 3225703233104165889 | |
218759170 | 2019-09-04 11:58:32 | 2019-09-04 11:58:32 | PKEY | TITLE | false | 3225703233104165890 |
The below exception is thrown in the atlassian-bamboo.log and UI when viewing the project:
org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2; nested exception is org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:262) at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:386) at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:335) at com.atlassian.bamboo.project.ProjectHibernateDao.getProjectByKey(ProjectHibernateDao.java:123) at sun.reflect.GeneratedMethodAccessor983.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy147.getProjectByKey(Unknown Source) at com.atlassian.bamboo.project.DefaultProjectManager.getProjectByKey(DefaultProjectManager.java:96)
Workaround
Introduce a minor sleep (2 - 4 seconds) between Bamboo Specs pushes.
- was cloned as
-
BAM-20705 Duplicate project keys when double clicking "save" on creating a new project
-
- Closed
-
-
BDEV-15585 Loading...
[BAM-20610] Possible to create duplicate project keys with concurrent Bamboo Specs pushes
Resolution | New: Fixed [ 1 ] | |
Status | Original: Waiting for Release [ 12075 ] | New: Closed [ 6 ] |
Support reference count | Original: 2 | New: 3 |
Support reference count | Original: 1 | New: 2 |
Status | Original: In Progress [ 3 ] | New: Waiting for Release [ 12075 ] |
Status | Original: Short Term Backlog [ 12074 ] | New: In Progress [ 3 ] |
Assignee | New: Marcin Gardias [ mgardias ] |
Fix Version/s | New: 7.0.0 [ 89610 ] |
Support reference count | New: 1 |
Remote Link | New: This issue links to "BDEV-15585 (Hello Jira)" [ 449516 ] |