mirror of
				https://github.com/avatao-content/baseimage-tutorial-framework
				synced 2025-11-04 02:52:55 +00:00 
			
		
		
		
	Avoid treating supervisord's SIGTERM as an error in CommandEventHandler
This commit is contained in:
		@@ -127,6 +127,9 @@ class CommandEventHandler(PipeIOEventHandler):
 | 
			
		||||
    @terminate_process_on_failure
 | 
			
		||||
    def _monitor_proc(self):
 | 
			
		||||
        return_code = self._proc.wait()
 | 
			
		||||
        if return_code == -int(SIGTERM):
 | 
			
		||||
            # supervisord asked the program to terminate, this is fine
 | 
			
		||||
            return
 | 
			
		||||
        if return_code != 0:
 | 
			
		||||
            _, stderr = self._proc.communicate()
 | 
			
		||||
            raise RuntimeError(f'Subprocess failed ({return_code})! Stderr:\n{stderr.decode()}')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user