Failed to delete a Red Hat SSO realm with very large number of users

Solution Unverified - Updated -

Issue

  • Failed to delete a Red Hat SSO realm with very large number of users by transaction timeout
WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a810014:36830782:5f2a85dc:1b746e in state  CANCEL_INTERRUPTED
WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012120: TransactionReaper::check worker Thread[Transaction Reaper Worker 2,5,main] not responding to interrupt when cancelling TX 0:ffff0a810014:36830782:5f2a85dc:1b746e -- worker marked as zombie and TX scheduled for mark-as-rollback
WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-13) SQL Error: 1205, SQLState: 41000
ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-13) Lock wait timeout exceeded; try restarting transaction
WARN  [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012110: TransactionReaper::check successfuly marked TX 0:ffff0a810014:36830782:5f2a85dc:1b746e as rollback only
WARN  [org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorTrackingImpl] (Transaction Reaper Worker 2) HHH000451: Transaction afterCompletion called by a background thread; delaying afterCompletion processing until the original thread can handle it. [status=4]
WARN  [com.arjuna.ats.arjuna] (Transaction Reaper Worker 2) ARJUNA012113: TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 2,5,main] missed interrupt when cancelling TX 0:ffff0a810014:36830782:5f2a85dc:1b746e -- exiting as zombie (zombie count decremented to 0)
ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-13) Uncaught server error: javax.persistence.LockTimeoutException: could not execute statement
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.wrapLockException(AbstractEntityManagerImpl.java:1741)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1644)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1700)
at org.hibernate.jpa.spi.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:70)
at org.keycloak.models.jpa.JpaUserProvider.preRemove(JpaUserProvider.java:388)
at org.keycloak.storage.UserStorageManager.preRemove(UserStorageManager.java:653)
at org.keycloak.models.cache.infinispan.UserCacheSession.preRemove(UserCacheSession.java:910)
at org.keycloak.models.jpa.JpaRealmProvider.removeRealm(JpaRealmProvider.java:129)
at org.keycloak.models.cache.infinispan.RealmCacheSession.removeRealm(RealmCacheSession.java:466)
at org.keycloak.services.managers.RealmManager.removeRealm(RealmManager.java:227)
at org.keycloak.services.resources.admin.RealmAdminResource.deleteRealm(RealmAdminResource.java:352)
(omitted)

Environment

  • Red Hat Single Sign On (RH-SSO)
    • 7.x
  • MySQL database

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In