Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-19127

Race condition at startup that can make Hibernate unusable

    XMLWordPrintable

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      In rare cases we noticed hibernate getting into a wrong state (without any hint) and generating excessive logging with the following "java.lang.IllegalStateException: EntityManagerFactory is closed " error:

      ERROR PreferencesConfigurationSource - Failed to access configuration value for property [notifications.enabled]. Ignoring by returning null ERROR PreferencesConfigurationSource - Failed to access configuration value for property [notifications.enabled]. Ignoring by returning null com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [xwiki:Main.WebPreferences] at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:1106) at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:394) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2133) at com.xpn.xwiki.XWiki.getDocument(XWiki.java:2195) at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseObject(AbstractXWikiPreferencesConfigurationSource.java:86) at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:139) at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:156) at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.getPropertyValue(AbstractDocumentConfigurationSource.java:348) at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.containsKey(AbstractDocumentConfigurationSource.java:203) at org.xwiki.configuration.internal.AbstractSpacesConfigurationSource$SpaceConfigurationSource.containsKey(AbstractSpacesConfigurationSource.java:171) at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.containsKey(AbstractCompositeConfigurationSource.java:45) at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.containsKey(AbstractCompositeConfigurationSource.java:45) at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.getProperty(AbstractCompositeConfigurationSource.java:95) at org.xwiki.notifications.internal.DefaultNotificationConfiguration.isEnabled(DefaultNotificationConfiguration.java:47) at org.xwiki.notifications.notifiers.internal.email.live.PrefilteringLiveNotificationEmailListener.onEvent(PrefilteringLiveNotificationEmailListener.java:78) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:320) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:285) at org.xwiki.observation.remote.internal.DefaultRemoteObservationManager.notify(DefaultRemoteObservationManager.java:168) at org.xwiki.observation.remote.internal.jgroups.DefaultJGroupsReceiver.receive(DefaultJGroupsReceiver.java:91) at org.jgroups.ReceiverAdapter.receive(ReceiverAdapter.java:24) at org.jgroups.JChannel.up(JChannel.java:814) at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:916) at org.jgroups.stack.Protocol.up(Protocol.java:338) at org.jgroups.protocols.FRAG2.up(FRAG2.java:196) at org.jgroups.protocols.FlowControl.up(FlowControl.java:418) at org.jgroups.protocols.FlowControl.up(FlowControl.java:418) at org.jgroups.stack.Protocol.up(Protocol.java:338) at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:297) at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:450) at org.jgroups.protocols.pbcast.NAKACK2.deliverBatch(NAKACK2.java:952) at org.jgroups.protocols.pbcast.NAKACK2.removeAndDeliver(NAKACK2.java:886) at org.jgroups.protocols.pbcast.NAKACK2.handleMessages(NAKACK2.java:860) at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:682) at org.jgroups.protocols.BARRIER.up(BARRIER.java:196) at org.jgroups.stack.Protocol.up(Protocol.java:338) at org.jgroups.protocols.FailureDetection.up(FailureDetection.java:197) at org.jgroups.stack.Protocol.up(Protocol.java:338) at org.jgroups.stack.Protocol.up(Protocol.java:338) at org.jgroups.stack.Protocol.up(Protocol.java:338) at org.jgroups.protocols.TP.passBatchUp(TP.java:1411) at org.jgroups.util.MaxOneThreadPerSender$BatchHandlerLoop.passBatchUp(MaxOneThreadPerSender.java:284) at org.jgroups.util.SubmitToThreadPool$BatchHandler.run(SubmitToThreadPool.java:136) at org.jgroups.util.MaxOneThreadPerSender$BatchHandlerLoop.run(MaxOneThreadPerSender.java:273) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)Caused by: java.lang.IllegalStateException: EntityManagerFactory is closed at org.hibernate.internal.SessionFactoryImpl.validateNotClosed(SessionFactoryImpl.java:513) at org.hibernate.internal.SessionFactoryImpl.getCache(SessionFactoryImpl.java:811) at org.hibernate.internal.AbstractSharedSessionContract.<init>(AbstractSharedSessionContract.java:157) at org.hibernate.internal.AbstractSessionImpl.<init>(AbstractSessionImpl.java:29) at org.hibernate.internal.SessionImpl.<init>(SessionImpl.java:221) at org.hibernate.internal.SessionFactoryImpl$SessionBuilderImpl.openSession(SessionFactoryImpl.java:1265) at org.hibernate.internal.SessionFactoryImpl.openSession(SessionFactoryImpl.java:459) at com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:794) at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:577) at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:976) ... 45 common frames omitted 

      The error message was printed 95k times on XWiki 12.10.8 with cluster setup in 1 day.
      The workaround for this error message has been to restart the wiki.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tmortagne Thomas Mortagne
              Reporter:
              oana.tabaranu Elena-Oana Florea
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: