Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Bug #379 (closed)

Opened 15 years ago

Closed 14 years ago

System types being unnecessarily updated by security system

Reported by: jamoore Owned by: jamoore
Priority: critical Cc:
Sprint: n.a.
Total Remaining Time: n.a.

Description

From #337:

20:23:21,165 INFO  [BasicSecuritySystem] Adding log:UPDATE,class ome.model.meta.Experimenter,135
20:23:21,165 INFO  [EventHandler]   Auth:       user=135,group=1,event=3524(User)
20:23:21,192 INFO  [BasicSecuritySystem] Adding log:UPDATE,class ome.model.acquisition.Microscope,13
20:23:21,193 INFO  [BasicSecuritySystem] Adding log:UPDATE,class ome.model.meta.Experimenter,133
20:23:21,233 INFO  [ServiceHandler] Rslt:       Microscope:Id_13

Attachments (1)

379.patch (18.5 KB) - added by jmoore 14 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 15 years ago by jmoore

Where this is happening:

  • call IUpdate.saveAndReturnObject() (not readOnly)
  • BasicSecuritySystem.setCurrentDetails() saves the current Event
  • That updates the Experimenter.

Go figure.

comment:2 Changed 15 years ago by jmoore

r991 has an attempted first fix. Doesn't go far enough.

comment:3 Changed 15 years ago by jmoore

  • Milestone changed from Unscheduled to 3.0-M4

Moving to milestone:3.0-M4 (see #410 for reason)

comment:4 Changed 15 years ago by jmoore

r1136 marks a test in bioformats-omero as broken.

comment:5 Changed 15 years ago by jmoore

org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: could not update: [ome.model.meta.Experimenter#0]
Caused by: org.hibernate.exception.GenericJDBCException: could not update: [ome.model.meta.Experimenter#0]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
 ...
Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected
  Detail: Process 8483 waits for ShareLock on transaction 5760781; blocked by process 8517.
Process 8517 waits for ExclusiveLock on tuple (5,58) of relation 404231 of database 403930; blocked by process 8483.
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307)
        at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:95)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2399)
        ... 62 more

comment:6 Changed 15 years ago by jmoore

  • Keywords set to iteration4
  • Priority changed from minor to critical

comment:7 Changed 15 years ago by cxallan

  • Owner changed from jmoore to callan
  • Status changed from new to assigned

This is also causing fairly major transactional deadlocks at times when actual system types are being updated:

org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: could not update: [ome.model.meta.Experimenter#0]
Caused by: org.hibernate.exception.GenericJDBCException: could not update: [ome.model.meta.Experimenter#0]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2421)
        at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2303)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2603)
        at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
        at org.springframework.orm.hibernate3.HibernateTemplate$27.doInHibernate(HibernateTemplate.java:801)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
        at org.springframework.orm.hibernate3.HibernateTemplate.flush(HibernateTemplate.java:799)
        at ome.logic.UpdateImpl.afterUpdate(UpdateImpl.java:261)
        at ome.logic.UpdateImpl.doAction(UpdateImpl.java:272)
        at ome.logic.UpdateImpl.saveAndReturnObject(UpdateImpl.java:129)
        at ome.security.basic.BasicSecuritySystem.loadEventContext(BasicSecuritySystem.java:1006)
        at ome.security.basic.EventHandler.invoke(EventHandler.java:123)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:104)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:148)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:91)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at ome.logic.AbstractBean.call(AbstractBean.java:152)
        at ome.logic.AbstractBean.loginAndSpringWrap(AbstractBean.java:107)
        at sun.reflect.GeneratedMethodAccessor241.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:146)
        at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)        at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.tx.BMTInterceptor.handleStateless(BMTInterceptor.java:71)
        at org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:131)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:167)
        at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:100)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:225)
        at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
        at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
        at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
        at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
        at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)

Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected
  Detail: Process 8483 waits for ShareLock on transaction 5760781; blocked by process 8517.
Process 8517 waits for ExclusiveLock on tuple (5,58) of relation 404231 of database 403930; blocked by process 8483.
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307)
        at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:95)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
        at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2399)
        ... 62 more

comment:8 Changed 15 years ago by cxallan

  • Owner changed from callan to jmoore
  • Status changed from assigned to new

Changed 14 years ago by jmoore

comment:9 Changed 14 years ago by jmoore

The 379.patch should fix the problem. The issue was that the null Details in the global types was being filled with a instance by the security system in order to lock the items. This can only happen when Permissions is also null which only happens in the global types. Since we're going to have to re-add Permissions to these types for delete anyway might as well do it soon.

The question is: when? This requires a DB update of the form:

  alter table eventlog add permissions bigint;
  update eventlog set permissions = 0;
  alter table eventlog alter permissions set not null;
  -- and possibly --
  alter table eventlog alter permissions set default 0;

for the tables:

  • eventlog
  • event
  • experimenter

comment:10 Changed 14 years ago by jmoore

r1397 applies the patch.

comment:11 Changed 14 years ago by jmoore

  • Resolution set to fixed
  • Status changed from new to closed

Haven't heard any complaints. But the patch does get us into the realm of #373. Closing.

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.62616 sec.)

We're Hiring!