OpenTSDB / tcollector

Data collection framework for OpenTSDB
http://opentsdb.net
GNU Lesser General Public License v3.0
513 stars 359 forks source link

tcollector daemon hangs and becomes unresponsive. #378

Closed xy-man closed 5 years ago

xy-man commented 6 years ago

https://github.com/OpenTSDB/tcollector/blob/6a4049050201653b10e31ada8d22e7a9a7b94fc8/tcollector.py#L1268

If kill (col.proc) command is failed, tcollector daemon hang with OSError: [Errno 3] No such process. This situation occurs when the process is terminated before os.killpg is called.

I think, kill function maybe needs to be modified like follow:

def kill(proc, signum=signal.SIGTERM):          
  try:                                          
    os.killpg(proc.pid, signum)                 
  except:                                       
    LOG.info('already killed: %s', proc.pid)