Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5087

ThreadLocal: BusFactory.threadBus is never removed, generates permgen out of memory error after some redeployments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.5
    • 2.7.6
    • Bus, Core
    • None
    • Unknown

    Description

      The ThreadLocal BusFactory.threadBus is created in the constructor of the CXFBusImpl and removed in the shutdown()-method.
      But in an application server environment (e.g. JBoss7) with thread pools the constructor and the shutdwon()-method are invoked from different threads and therefore this ThreadLocal is never removed.

      Issue CXF-2164 and CXF-2985 do already discuss this topic and assume that this bug is fixed, but there is still this dangling ThreadLocal. I proved this in a JBoss7.1.1.Final environment.

      I don't know the reason for having this ThreadLocal for the whole lifetime of the bus. From my point of view a ThreadLocal should only exist for the lifetime of one request. At the end of the request, when the thread is given back to the pool, the ThreadLocal must be cleared.

      Attachments

        Issue Links

          Activity

            People

              dkulp Daniel Kulp
              rpreissel Rene Preissel
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: