Uploaded image for project: 'Syncope'
  1. Syncope
  2. SYNCOPE-1241

Under high load propagation after pull might fail

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.6
    • Fix Version/s: 2.0.7, 2.1.0
    • Component/s: core
    • Labels:
      None

      Description

      The PriorityPropagationTaskExecutor is designed to run the assigned PropagationTask instance via a CompletionService, e.g. potentially in a separate thread.

      Dach PropagationTask instance carries a reference to ExternalResource, and in the end to the underlying JDBC connection (via OpenJPA); given what said above, it might happen that a PropagationTask is executed in a different thread than the one it was created in, resulting in errors as follows:

      ERROR org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor - Exception during provision on resource USERSCHED-write
      org.apache.openjpa.persistence.PersistenceException: This statement has been closed.
              at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5003) ~[openjpa-jdbc-2.4.2.jar:2.4.2]
              at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4963) ~[openjpa-jdbc-2.4.2.jar:2.4.2]
              at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:133) ~[openjpa-jdbc-2.4.2.jar:2.4.2]
              at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:115) ~[openjpa-jdbc-2.4.2.jar:2.4.2]
              at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:67) ~[openjpa-jdbc-2.4.2.jar:2.4.2]
              at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:687) ~[openjpa-jdbc-2.4.2.jar:2.4.2]
              at org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:117) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.openjpa.datacache.DataCacheStoreManager.load(DataCacheStoreManager.java:462) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:117) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:3145) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.openjpa.kernel.StateManagerImpl.loadField(StateManagerImpl.java:3225) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.openjpa.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1690) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1624) ~[openjpa-kernel-2.4.2.jar:2.4.2]
              at org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource.pcGetorgUnit(JPAExternalResource.java) ~[syncope-core-persistence-jpa-2.0.6.jar:2.0.6]
              at org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource.getOrgUnit(JPAExternalResource.java:238) ~[syncope-core-persistence-jpa-2.0.6.jar:2.0.6]
              at org.apache.syncope.core.provisioning.java.propagation.AbstractPropagationTaskExecutor.execute(AbstractPropagationTaskExecutor.java:389) ~[syncope-core-provisioning-java-2.0.6.jar:2.0.6]
              at org.apache.syncope.core.provisioning.java.propagation.DefaultPropagationTaskCallable.call(DefaultPropagationTaskCallable.java:89) ~[syncope-core-provisioning-java-2.0.6.jar:2.0.6]
              at org.apache.syncope.core.provisioning.java.propagation.DefaultPropagationTaskCallable.call(DefaultPropagationTaskCallable.java:38) ~[syncope-core-provisioning-java-2.0.6.jar:2.0.6]
              at sun.reflect.GeneratedMethodAccessor798.invoke(Unknown Source) ~[?:?]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
              at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) ~[spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at org.apache.syncope.core.persistence.jpa.spring.DomainTransactionInterceptor.invoke(DomainTransactionInterceptor.java:64) ~[syncope-core-persistence-jpa-2.0.6.jar:2.0.6]
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
              at com.sun.proxy.$Proxy295.call(Unknown Source) ~[?:?]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_151]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_151]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_151]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_151]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_151]
              at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
      Caused by: org.postgresql.util.PSQLException: This statement has been closed.
              at org.postgresql.jdbc.PgStatement.checkClosed(PgStatement.java:647) ~[postgresql-42.1.1.jar:42.1.1]
      

      Such errors are observed especially when, as a result of a PullTask execution, several PropagationTasks are generated and executed.

        Attachments

          Activity

            People

            • Assignee:
              ilgrosso Francesco Chicchiriccò
              Reporter:
              ilgrosso Francesco Chicchiriccò
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: