Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-6533

(15.0.x) Memory leak in ElytronDefinition / DelegatingAuthConfigFactory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 15.0.1.Final
    • Security
    • Hide
      • Run EAP in standalone mode,
      • run :reload operations repeatedly,
      • in a profiling tool check that new instances of ElytronAuthConfigFactory and DelegatingAuthConfigFactory are being created and are not garbage collected.

      See JBEAP-25589 for more detailed reproducer.

      Show
      Run EAP in standalone mode, run :reload operations repeatedly, in a profiling tool check that new instances of ElytronAuthConfigFactory and DelegatingAuthConfigFactory are being created and are not garbage collected. See JBEAP-25589 for more detailed reproducer.

      This issue is only present in wildfly-core 15.0.x branch. It is a component of JBEAP-25589.

      During app server reload, the Elytron integration layer registers new AuthConfigFactory:

      ElytronDefinition$ElytronAdd#performBoottime():

                      final AuthConfigFactory authConfigFactory = doPrivileged((PrivilegedAction<AuthConfigFactory>) ElytronDefinition::getAuthConfigFactory);
                      if (authConfigFactory != null) {
                          // TODO This wrapping is only temporary to allow us to delegate to the PicketBox impl, at a later point there really should only
                          //  be one AuthConfigFactory at a time.
                          registerAuthConfigFactory(new DelegatingAuthConfigFactory(new ElytronAuthConfigFactory(), authConfigFactory, ALLOW_DELEGATION));
                      } else {
                          ...
                      }
      

      The factory registered is the DelegatingAuthConfigFactory chained with the original AuthConfigFactory instance. The original factory instance is obtained just before the register call. In effect, during the reload operation the chain of DelegatingAuthConfigFactory instances becomes deeper and deeper, as the previously created instances are used as delegates of the new instance.

              fjuma1@redhat.com Farah Juma
              thofman Tomas Hofman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: