Diogo Monteiro created CLOUDSTACK-6988:
------------------------------------------
Summary: Entity exists exception during parallel creation of
subnet rules
Key: CLOUDSTACK-6988
URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6988
Project: CloudStack
Issue Type: Bug
Security Level: Public (Anyone can view this level - this is the default.)
Components: API
Affects Versions: 4.2.0
Environment: CentOS
Reporter: Diogo Monteiro
Java persistence exception is being thrown when creating subnet rules in
parallel.
Steps to reproduce:
#1 Create VPC
#2 Create Subnet
#3 With a script, create 20+ subnet rules in parallel
Desired results:
All rules should be created
Actual results:
javax.persistence.EntityExistsException is thrown
It was confirmed that by creating the subnet rules synchronously no exception
is thrown, the problem exists only when creating the rules in parallel
Stack trace:
2014-06-24 15:38:05,228 ERROR [cloud.api.ApiServer] (ApiServer-10:null)
unhandled exception executing api command: createNetworkACL
javax.persistence.EntityExistsException: Entity already exists:
at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1346)
at
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
at
com.cloud.network.vpc.NetworkACLManagerImpl.createNetworkACLItem(NetworkACLManagerImpl.java:230)
at
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
at
com.cloud.network.vpc.NetworkACLServiceImpl.createNetworkACLItem(NetworkACLServiceImpl.java:313)
at
org.apache.cloudstack.api.command.user.network.CreateNetworkACLCmd.create(CreateNetworkACLCmd.java:213)
at com.cloud.api.ApiDispatcher.dispatchCreateCmd(ApiDispatcher.java:104)
at com.cloud.api.ApiServer.queueCommand(ApiServer.java:460)
at com.cloud.api.ApiServer.handleRequest(ApiServer.java:372)
at com.cloud.api.ApiServer.handle(ApiServer.java:303)
at org.apache.http.protocol.HttpService.doService(HttpService.java:375)
at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:290)
at com.cloud.api.ApiServer$WorkerTask.run(ApiServer.java:978)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Caused by:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Duplicate entry '738-2' for key 'acl_id'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2450)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2371)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2355)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at com.cloud.utils.db.GenericDaoBase.persist(GenericDaoBase.java:1311)
--
This message was sent by Atlassian JIRA
(v6.2#6252)