def exit_routine()

in src/hyperpod_nemo_adapter/utils/tracer_utils.py [0:0]


    def exit_routine(self):
        if not self.tracer:
            return

        if self._exiting:
            return

        self._exiting = True
        self.tracer.stop()
        # concurrent.future requires a proper release by executing
        # threading._threading_atexits or it will deadlock if not explicitly
        # release the resource in the code
        # Python 3.9+ has this issue
        if threading._threading_atexits:
            for atexit_call in threading._threading_atexits:
                atexit_call()
            threading._threading_atexits = []

        self.tracer.exit_routine()
        self.save()