-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Fix Version/s: 10.10-HF19, 11.1, 2021.0
-
Component/s: Core
-
Release Notes Summary:The binary GC is executed in a long-running transaction.
-
Tags:
-
Backlog priority:600
-
Sprint:nxplatform 11.1.23
-
Story Points:2
Deleting the orphan binaries could easily lead to a transaction timeout when the binary store contain 1 million documents or more, see stack trace below.
This operation should be improved by adding a mechanism which prevents from having the timeout. It could be:
- setting a huge transaction timeout value at the beginning of the operation
- committing regularly the transaction
- running the GC outside a transaction, which may be difficult for the part when the connection to the database is required
2019-11-25T12:04:19,931 ERROR [SystemInfoManager] Error while executing BinariesGCTask java.lang.RuntimeException: javax.resource.ResourceException: org.nuxeo.runtime.transaction.TransactionRuntimeException: Unable to commit: Transaction timeout at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.markReferencedBinaries(RepositoryImpl.java:490) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.ra.ManagedConnectionFactoryImpl.markReferencedBinaries(ManagedConnectionFactoryImpl.java:216) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.ra.ConnectionFactoryImpl.markReferencedBinaries(ConnectionFactoryImpl.java:211) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.blob.DocumentBlobManagerComponent.garbageCollectBinaries(DocumentBlobManagerComponent.java:252) ~[nuxeo-core-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.management.SQLRepositoryStatus.gcBinaries(SQLRepositoryStatus.java:94) ~[nuxeo-core-storage-sql-management-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.admin.SystemInfoManager$BinariesGCTask.run(SystemInfoManager.java:355) [nuxeo-admin-center-jsf-11.1-SNAPSHOT.jar:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: javax.resource.ResourceException: org.nuxeo.runtime.transaction.TransactionRuntimeException: Unable to commit: Transaction timeout at org.nuxeo.ecm.core.storage.sql.SessionImpl.close(SessionImpl.java:246) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.markReferencedBinaries(RepositoryImpl.java:487) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] ... 6 more Caused by: org.nuxeo.runtime.transaction.TransactionRuntimeException: Unable to commit: Transaction timeout at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:410) ~[nuxeo-runtime-jtajca-11.1-SNAPSHOT.jar:?] at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:617) ~[nuxeo-runtime-jtajca-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doConnectAndInvoke(JDBCMapperConnector.java:95) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.invoke(JDBCMapperConnector.java:84) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at com.sun.proxy.$Proxy77.close(Unknown Source) ~[?:?] at org.nuxeo.ecm.core.storage.sql.SoftRefCachingMapper.close(SoftRefCachingMapper.java:78) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.SessionImpl.closeSession(SessionImpl.java:254) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.SessionImpl.close(SessionImpl.java:243) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.markReferencedBinaries(RepositoryImpl.java:487) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] ... 6 more Caused by: javax.transaction.RollbackException: Unable to commit: Transaction timeout at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:267) ~[geronimo-transaction-2.2.1.jar:2.2.1] at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) ~[geronimo-transaction-2.2.1.jar:2.2.1] at org.nuxeo.runtime.jtajca.NuxeoContainer$UserTransactionImpl.commit(NuxeoContainer.java:538) ~[nuxeo-runtime-jtajca-11.1-SNAPSHOT.jar:?] at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:393) ~[nuxeo-runtime-jtajca-11.1-SNAPSHOT.jar:?] at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:617) ~[nuxeo-runtime-jtajca-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doConnectAndInvoke(JDBCMapperConnector.java:95) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.invoke(JDBCMapperConnector.java:84) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at com.sun.proxy.$Proxy77.close(Unknown Source) ~[?:?] at org.nuxeo.ecm.core.storage.sql.SoftRefCachingMapper.close(SoftRefCachingMapper.java:78) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.SessionImpl.closeSession(SessionImpl.java:254) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.SessionImpl.close(SessionImpl.java:243) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.markReferencedBinaries(RepositoryImpl.java:487) ~[nuxeo-core-storage-sql-11.1-SNAPSHOT.jar:?] ... 6 more
- is related to
-
NXP-27346 Don't timeout during long imports
- Resolved