          logger.debug(retval)
          return retval
  
      def join(self) -> None:
          """ Join the running threads, catching and re-raising any errors """
          logger.debug("Joining Threads: '%s'", self._name)
          for thread in self._threads:
              logger.debug("Joining Thread: '%s'", thread._name)  # pylint: disable=protected-access
              thread.join()
              if thread.err:
 
</s> remove             del thread
 </s> add  </s> remove         logger.debug("Setting thread")
 </s> add         logger.trace("Setting thread")  # type:ignore[attr-defined] </s> remove             logger.debug("Thread pre-exists and is alive: %s", self._thread)
 </s> add             logger.trace("Thread pre-exists and is alive: %s",  # type:ignore[attr-defined]
                         self._thread) </s> remove             extract.process()
 </s> add             if len(self._input_locations) > 1:
                # TODO - Running this in a process is hideously hacky. However, there is a memory
                # leak in some instances when running in batch mode. Many days have been spent
                # trying to track this down to no avail (most likely coming from C-code.) Running
                # the extract job inside a process prevents the memory leak in testing. This should
                # be replaced if/when the memory leak is found
                proc = Process(target=extract.process)
                proc.start()
                proc.join()
            else:
                extract.process()
        """ Join the running threads, catching and re-raising any errors

        Clear the list of threads for class instance re-use
        """
          logger.debug(retval)
          return retval
  
      def join(self) -> None:
        """ Join the running threads, catching and re-raising any errors

        Clear the list of threads for class instance re-use
        """
          logger.debug("Joining Threads: '%s'", self._name)
          for thread in self._threads:
              logger.debug("Joining Thread: '%s'", thread._name)  # pylint: disable=protected-access
              thread.join()
              if thread.err:
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Patch extract memory leak in batch mode 
lib/multithreading.py