Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3842

Netty direct buffer detection broken due to missing module dependencies

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 9.0.0.Beta1
    • 8.1.0.Final, 9.0.0.Alpha1
    • JMS
    • None
    • Hide

      Start up Wildfly 8.1 with logging set to "TRACE" on io.netty. Inspect the startup log messages and note that direct buffers aren't reliably detected and the netty message requesting javassist for improved performance.

      Show
      Start up Wildfly 8.1 with logging set to "TRACE" on io.netty. Inspect the startup log messages and note that direct buffers aren't reliably detected and the netty message requesting javassist for improved performance.

      When deploying Wildfly 8.x, you'll see this in the server.log:

      INFO [io.netty.util.internal.PlatformDependent] Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to av
      oid potential system unstability.
      

      Following this into netty, here:
      https://github.com/netty/netty/blob/master/common/src/main/java/io/netty/util/internal/PlatformDependent.java#L581
      Down to here:
      https://github.com/netty/netty/blob/netty-4.0.15.Final/common/src/main/java/io/netty/util/internal/PlatformDependent0.java#L82

      We need access to sun.misc to see if direct buffers are available.

      Adding sun.misc to the netty module removes the log message, but if we TRACE on io.netty, there is one additional message:

      2014-09-09 13:58:35,512 FINE [io.netty.util.internal.PlatformDependent] -Dio.netty.noJavassist: false
      2014-09-09 13:58:35,513 FINE [io.netty.util.internal.PlatformDependent] Javassist: unavailable
      2014-09-09 13:58:35,513 FINE [io.netty.util.internal.PlatformDependent] You don't have Javassist in your class path or you don't have enough permission to load dynamically generated classes.  Please check the configuration for better performance.
      

      We can provide netty with a depends on Javassist to remove the FINE message about performance.

      Workaround: alter the module io/netty/main/module.xml to include the following

      <module xmlns="urn:jboss:module:1.3" name="io.netty">
          <resources>
              <resource-root path="netty-all-4.0.15.Final.jar"/>
          </resources>
      
          <dependencies>
              <module name="sun.jdk"/>
              <module name="org.javassist"/>
          </dependencies>
      </module>
      

              jmesnil1@redhat.com Jeff Mesnil
              innerverse Seth Miller (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: