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

Weld deployment services not cleaned up properly if a deployment fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 10.0.0.CR5
    • 10.0.0.CR4
    • CDI / Weld
    • None

      The cleanup is currently only performed as a part of org.jboss.as.weld.WeldStartService.stop(StopContext) invocation. However, if WeldStartService.start() fails (e.g. because of a validation error) the stop method is never invoked. Some Weld bootstrap services need to clean up resources even if the deployment fails, e.g. org.jboss.weld.bootstrap.events.ContainerLifecycleEvents (deactivable optimization) maintains a separate thread pool and so the referenced ExecutorService is never shut down explicitly and the only hope to free resources is the GC and finalizers whose execution is deferred and may never even occur.

      We've run into this problem when executing Weld and CDI TCK test suites on a specific HP-UX machine. Both test suites contain a lot of scenarios where the deployment fails. HP-UX jvm cannot handle this load and the test suite fails with "java.lang.OutOfMemoryError: unable to create new native thread".

              mkouba@redhat.com Martin Kouba
              mkouba@redhat.com Martin Kouba
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: