code: def sig_handler(self, sig, _):
          
          import tornado.ioloop
          from tornado.process import task_id
          tid = task_id()
          pid = os.getpid()
          if tid is None:
              logger.warning("main process (pid %s) caught signal: %s" %
                             (pid, sig))
          else:
              logger.warning("child %s (pid %s) caught signal: %s" %
                             (tid, pid, sig))
          tornado.ioloop.IOLoop.current().add_callback(self.shutdown)
docs: Handle the signal sent to the process
          :param sig:  Signal set to the process
          :param _: Frame is not being used