Alex Rudyy created QPID-6196:
--------------------------------

             Summary: Race condition makes it possible to create 2 queues with 
the same name on the same VirtualHost
                 Key: QPID-6196
                 URL: https://issues.apache.org/jira/browse/QPID-6196
             Project: Qpid
          Issue Type: Bug
          Components: Java Broker
    Affects Versions: 0.30
            Reporter: Alex Rudyy
            Assignee: Alex Rudyy
             Fix For: 0.31


When writing a test client with 2 threads (1 for publishing and 1 for 
consuming) that both used the same queue name and were started immediately one 
after the other, the broker ended up with 2 queues both with the same name.  
Both threads performed the "session.createConsumer(destination)" call, the 
producer to ensure the queue existed and the consumer to create the consumer 
(obv). This was changed but should not have resulted in the queue being created 
twice as the conflict should be detected.

This resulted in the following error when restarting the broker and the VH 
coming up in ERRORED state.

2014-10-27 12:06:45,945 ERROR [main] (model.AbstractConfiguredObject) - Failed 
to open object with name 'default'.  Object will be put into ERROR state.
org.apache.qpid.server.model.AbstractConfiguredObject$DuplicateNameException: 
Child of type StandardQueueImpl already exists with name of testQueue
        at 
org.apache.qpid.server.model.AbstractConfiguredObject.registerChild(AbstractConfiguredObject.java:1389)
        at 
org.apache.qpid.server.model.AbstractConfiguredObject.registerWithParents(AbstractConfiguredObject.java:455)
        at 
org.apache.qpid.server.model.AbstractConfiguredObjectTypeFactory$GenericUnresolvedConfiguredObject.resolve(AbstractConfiguredObjectTypeFactory.java:113)
        at 
org.apache.qpid.server.model.AbstractConfiguredObjectTypeFactory$GenericUnresolvedConfiguredObject.resolve(AbstractConfiguredObjectTypeFactory.java:92)
        at 
org.apache.qpid.server.store.GenericRecoverer.resolveObjects(GenericRecoverer.java:172)
        at 
org.apache.qpid.server.store.GenericRecoverer.performRecover(GenericRecoverer.java:77)
        at 
org.apache.qpid.server.store.GenericRecoverer.access$000(GenericRecoverer.java:40)
        at 
org.apache.qpid.server.store.GenericRecoverer$1.execute(GenericRecoverer.java:58)
        at 
org.apache.qpid.server.configuration.updater.TaskExecutorImpl$2.execute(TaskExecutorImpl.java:149)
        at 
org.apache.qpid.server.configuration.updater.TaskExecutorImpl$2.execute(TaskExecutorImpl.java:145)
        at 
org.apache.qpid.server.configuration.updater.TaskExecutorImpl.executeTask(TaskExecutorImpl.java:299)
        at 
org.apache.qpid.server.configuration.updater.TaskExecutorImpl.access$400(TaskExecutorImpl.java:43)
        at 
org.apache.qpid.server.configuration.updater.TaskExecutorImpl$CallableWrapper$1.run(TaskExecutorImpl.java:327)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:360)
        at 
org.apache.qpid.server.configuration.updater.TaskExecutorImpl$CallableWrapper.call(TaskExecutorImpl.java:322)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to