code: def on_exception(self):
      if self._pids is not None:
          exc_type, exc_value, exc_traceback_obj = sys.exc_info()
          traceback.print_tb(exc_traceback_obj, file=sys.stderr)
          sys.stderr.write(
              f"Start to stop these pids:{self._pids}, please wait several seconds.\n"
          )
          for pid in self._pids:
              pid = pid.item()
              if pid != os.getpid():
                  os.kill(pid, signal.SIGKILL)
  
file_path: fastNLP/tests/core/drivers/paddle_driver/test_dist_utils.py
imports: import os
  import sys
  import signal
  import pytest
  import traceback
  import numpy
  from fastNLP.core.drivers.paddle_driver.dist_utils import _tensor_to_object, _object_to_tensor, fastnlp_paddle_all_gather, fastnlp_paddle_broadcast_object
  from fastNLP.core.drivers.paddle_driver.fleet_launcher import FleetLauncher
  from tests.helpers.utils import magic_argv_env_context
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE
label_desc: Use image node_id 2 for calling the TestAllGatherAndBroadCast obj's underlying member method code with example usage: obj.on_exception() without return types