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

Tika initialization in XWikiAttachment#getMimeType can block many threads and the opposite

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.4
    • 6.4-rc-1
    • Old Core
    • Unknown
    • N/A
    • N/A

    Description

      Tika default configuration initialization is loading classes from String each time we create an instance of Tika class and at least in Tomcat WebappClassLoader.loadClass deal with thread safety using a lock which mean everything which load a class is stuck waiting for something that happen several times on each page containing attachments.

      Example of a BLOCKED thread in myxwiki.org:

       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1603)
              - waiting to lock <0x00000007800df9c8> (a org.apache.catalina.loader.WebappClassLoader)
              at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
              at org.apache.tika.config.ServiceLoader.loadStaticServiceProviders(ServiceLoader.java:310)
              at org.apache.tika.parser.DefaultParser.getDefaultParsers(DefaultParser.java:50)
              at org.apache.tika.parser.DefaultParser.<init>(DefaultParser.java:73)
              at org.apache.tika.config.TikaConfig.getDefaultParser(TikaConfig.java:72)
              at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:178)
              at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:287)
              at org.apache.tika.Tika.<init>(Tika.java:115)
              at com.xpn.xwiki.doc.XWikiAttachment.getMimeType(XWikiAttachment.java:746)
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: