Senaka Fernando wrote:
>
>
> On Wed, Feb 24, 2010 at 12:22 PM, Ruwan Linton <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Running perf tests will help us identify these issues.
>
>     Senaka Fernando wrote:
>     > Hi it seems that you have persisted a resource + created an
>     > association at the same time in two threads.
>     Are you trying to say that Registry cannot handle 2 concurrent
>     requests??
>
>     Folks, none of these scenarios shouldn't cause a deadlock, these are
>     possible scenarios, at exceptional flows and Registry shouldn't
>     deadlock, rather it should handle them gracefully. It might decide to
>     fail some operations, but cannot deadlock.
>
>
> Even the current implementation doesn't deadlock. But, we don't 
> gracefully handle this. We instead let it be handled by the driver, 
> which simply rolls back the second transaction and let the first one 
> in. But, it expects these to be handled at a higher level, and writes 
> out the exception stating deadlocked. Hence the confusion.
Correct! what I am saying is we have to handle it, not the driver. We 
shouldn't assume that driver will take care of everything, rather we 
need to program the flow in a manner that it doesn't cause any deadlocks 
to be detected by the driver.

Thanks,
Ruwan
>
> Thanks,Senaka.
>
>
>     Thanks,
>     Ruwan
>     > How could this happen? Is it a part of the same process? or two
>     > things? And +1 for running perf tests. But, this time we need to
>     > eradicate the possibilities of such or at least introduce some retry
>     > mechanism (or handle exceptions), instead of simply treating
>     this as a
>     > perf issue. Not everybody have the same hardware configurations that
>     > we do, and there can be possibilities of such.
>     >
>     > Thanks,
>     > Senaka.
>     >
>     > On Wed, Feb 24, 2010 at 11:52 AM, Sumedha Rubasinghe
>     <[email protected] <mailto:[email protected]>
>     > <mailto:[email protected] <mailto:[email protected]>>> wrote:
>     >
>     >     Hi Hiranya,
>     >     Did you press save config button multiple times?
>     >
>     >     /sumedha
>     >
>     >
>     >
>     >     On Wed, Feb 24, 2010 at 11:28 AM, Hiranya Jayathilaka
>     >     <[email protected] <mailto:[email protected]>
>     <mailto:[email protected] <mailto:[email protected]>>> wrote:
>     >
>     >         Following exception encountered in the ESB while updating a
>     >         proxy service:
>     >
>     >
>     >         Exception in thread "Thread-23"
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.ServiceBusPersistenceException:
>     >         Error while saving mediation configuration changes
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager.handleException(MediationPersistenceManager.java:278)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager.access$1200(MediationPersistenceManager.java:48)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager$MediationPersistenceWorker.run(MediationPersistenceManager.java:320)
>     >         Caused by:
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.ServiceBusPersistenceException:
>     >         Unable to persist the proxy service in the path :
>     >         /repository/synapse/proxy-services/FooProxy
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.registry.AbstractRegistryStore.handleException(AbstractRegistryStore.java:101)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.registry.ProxyServiceRegistryStore.persistElement(ProxyServiceRegistryStore.java:72)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.AbstractStore.saveToRegistry(AbstractStore.java:154)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.AbstractStore.save(AbstractStore.java:82)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager.persistElement(MediationPersistenceManager.java:335)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager.access$1000(MediationPersistenceManager.java:48)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.MediationPersistenceManager$MediationPersistenceWorker.run(MediationPersistenceManager.java:314)
>     >         Caused by:
>     >         org.wso2.carbon.registry.core.exceptions.RegistryException:
>     >         Unable to persist element
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.registry.AbstractRegistryStore.persistElement(AbstractRegistryStore.java:95)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.registry.ProxyServiceRegistryStore.persistElement(ProxyServiceRegistryStore.java:69)
>     >         ... 5 more
>     >         Caused by:
>     >         org.wso2.carbon.registry.core.exceptions.RegistryException:
>     >         Failed to add log entry for resource
>     >         /_system/config/repository/synapse/proxy-services. Deadlock
>     >         detected. The current transaction was rolled back. Details:
>     >         Session #9 (user: WSO2CARBON) is waiting to lock
>     >         PUBLIC.REG_RESOURCE while locking PUBLIC.REG_ASSOCIATION
>     >         (exclusive), PUBLIC.REG_LOG (exclusive).
>     >         Session #12 (user: WSO2CARBON) is waiting to lock
>     >         PUBLIC.REG_LOG while locking PUBLIC.REG_CONTENT_HISTORY
>     >         (exclusive), PUBLIC.REG_RESOURCE_HISTORY (exclusive),
>     >         PUBLIC.REG_RESOURCE (exclusive), PUBLIC.REG_CONTENT
>     >         (exclusive), PUBLIC.REG_SNAPSHOT (exclusive).; SQL
>     statement:
>     >         INSERT INTO REG_LOG (REG_PATH, REG_USER_ID, REG_LOGGED_TIME,
>     >         REG_ACTION, REG_ACTION_DATA, REG_TENANT_ID) VALUES (?, ?, ?,
>     >         ?, ?, ?) [40001-112]
>     >         at
>     >        
>     org.wso2.carbon.registry.core.jdbc.dao.LogsDAO.addLog(LogsDAO.java:79)
>     >         at
>     >        
>     org.wso2.carbon.registry.core.jdbc.Repository.update(Repository.java:966)
>     >         at
>     >        
>     
> org.wso2.carbon.registry.core.jdbc.Repository.updateParent(Repository.java:947)
>     >         at
>     >        
>     org.wso2.carbon.registry.core.jdbc.Repository.delete(Repository.java:403)
>     >         at
>     >        
>     
> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.delete(EmbeddedRegistry.java:807)
>     >         at
>     >        
>     
> org.wso2.carbon.registry.core.session.UserRegistry.delete(UserRegistry.java:625)
>     >         at
>     >        
>     
> org.wso2.carbon.mediation.initializer.persistence.registry.AbstractRegistryStore.persistElement(AbstractRegistryStore.java:79)
>     >         ... 6 more
>     >         Caused by: org.h2.jdbc.JdbcSQLException: Deadlock detected.
>     >         The current transaction was rolled back. Details:
>     >         Session #9 (user: WSO2CARBON) is waiting to lock
>     >         PUBLIC.REG_RESOURCE while locking PUBLIC.REG_ASSOCIATION
>     >         (exclusive), PUBLIC.REG_LOG (exclusive).
>     >         Session #12 (user: WSO2CARBON) is waiting to lock
>     >         PUBLIC.REG_LOG while locking PUBLIC.REG_CONTENT_HISTORY
>     >         (exclusive), PUBLIC.REG_RESOURCE_HISTORY (exclusive),
>     >         PUBLIC.REG_RESOURCE (exclusive), PUBLIC.REG_CONTENT
>     >         (exclusive), PUBLIC.REG_SNAPSHOT (exclusive).; SQL
>     statement:
>     >         INSERT INTO REG_LOG (REG_PATH, REG_USER_ID, REG_LOGGED_TIME,
>     >         REG_ACTION, REG_ACTION_DATA, REG_TENANT_ID) VALUES (?, ?, ?,
>     >         ?, ?, ?) [40001-112]
>     >         at org.h2.message.Message.getSQLException(Message.java:107)
>     >         at org.h2.message.Message.getSQLException(Message.java:118)
>     >         at org.h2.message.Message.getSQLException(Message.java:77)
>     >         at org.h2.table.TableData.doLock(TableData.java:428)
>     >         at org.h2.table.TableData.lock(TableData.java:375)
>     >         at org.h2.command.dml.Insert.update(Insert.java:99)
>     >         at
>     >        
>     org.h2.command.CommandContainer.update(CommandContainer.java:71)
>     >         at org.h2.command.Command.executeUpdate(Command.java:207)
>     >         at
>     >        
>     
> org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:139)
>     >         at
>     >        
>     
> org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:128)
>     >         at
>     >        
>     
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
>     >         at
>     >        
>     org.wso2.carbon.registry.core.jdbc.dao.LogsDAO.addLog(LogsDAO.java:72)
>     >         ... 12 more
>     >
>     >         Thanks
>     >         --
>     >         Hiranya Jayathilaka
>     >         Software Engineer;
>     >         WSO2 Inc.;  http://wso2.org
>     >         E-mail: [email protected] <mailto:[email protected]>
>     <mailto:[email protected] <mailto:[email protected]>>;  Mobile:
>     >         +94 77 633 3491
>     >         Blog: http://techfeast-hiranya.blogspot.com
>     >
>     >         _______________________________________________
>     >         Carbon-dev mailing list
>     >         [email protected] <mailto:[email protected]>
>     <mailto:[email protected] <mailto:[email protected]>>
>     >         https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>     >
>     >
>     >
>     >     _______________________________________________
>     >     Carbon-dev mailing list
>     >     [email protected] <mailto:[email protected]>
>     <mailto:[email protected] <mailto:[email protected]>>
>     >     https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>     >
>     >
>     >
>     >
>     > --
>     > Senaka Fernando
>     > Software Engineer
>     > WSO2 Inc.
>     > E-mail: senaka AT wso2.com <http://wso2.com> <http://wso2.com>;
>      Mobile: +94 77 322 1818
>     >
>     > http://www.wso2.com/ - "Lean . Enterprise . Middleware"
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > Carbon-dev mailing list
>     > [email protected] <mailto:[email protected]>
>     > https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>     >
>
>
>     --
>     Ruwan Linton
>     Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
>     WSO2 Inc.; http://wso2.org
>     email: [email protected] <mailto:[email protected]>; cell: +94 77 341 3097
>     blog: http://blog.ruwan.org
>
>     Lean . Enterprise . Middleware
>
>
>     _______________________________________________
>     Carbon-dev mailing list
>     [email protected] <mailto:[email protected]>
>     https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>
>
>
> -- 
> Senaka Fernando
> Software Engineer
> WSO2 Inc.
> E-mail: senaka AT wso2.com <http://wso2.com>;  Mobile: +94 77 322 1818
>
> http://www.wso2.com/ - "Lean . Enterprise . Middleware"
> ------------------------------------------------------------------------
>
> _______________________________________________
> Carbon-dev mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>   


-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: [email protected]; cell: +94 77 341 3097
blog: http://blog.ruwan.org

Lean . Enterprise . Middleware


_______________________________________________
Carbon-dev mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to