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

Disable FILE_PING and its subclasses' register_shutdown_hook as its leaking resources

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 40.0.0.Beta1
    • 39.0.0.Final, 39.0.1.Final
    • Clustering
    • None
    • Workaround Exists
    • Hide

      Configure a FILE_PING or its subclasses manually with property 'register_shutdown_hook=false'.

      Show
      Configure a FILE_PING or its subclasses manually with property 'register_shutdown_hook=false'.
    • ---
    • ---

      WildFly already handles JVM shutdown gracefully so it should by default disable register_shutdown_hook which defaults to true in vanilla JGroups. We can only do this for loadable protocols.

      This impl is problematic as it causes a memory leak.

      Follow up on JGRP-2976:

      FILE_PING registers a JVM shutdown hook in init() but doesn't keep a reference to it, so the hook cannot be removed when the protocol stops.

      • The shutdown hook to remain registered even after the channel is closed
      • Memory leaks when channels are repeatedly created and destroyed - Thread is anonymous class and keeps reference to the stack via up/down protocol references
      • Errors when closing gracefully and then shutdown hook operates on closed resources

      This also affects subclasses such as JDBC_PING, S3_PING, etc.

              rhn-engineering-rhusar Radoslav Husar
              rhn-engineering-rhusar Radoslav Husar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: