def _configure_interrupt(self, function_name, timeout, container, is_debugging):
def timer_handler():<EOL><INDENT>LOG.info("<STR_LIT>", function_name, timeout)<EOL>self._container_manager.stop(container)<EOL><DEDENT>def signal_handler(sig, frame):<EOL><INDENT>LOG.info("<STR_LIT>", function_name)<EOL>self._container_manager.stop(container)<EOL><DEDENT>if is_debugging:<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL>signal.signal(signal.SIGTERM, signal_handler)<EOL><DEDENT>else:<EOL><INDENT>LOG.debug("<STR_LIT>", timeout, function_name)<EOL>timer = threading.Timer(timeout, timer_handler, ())<EOL>timer.start()<EOL>return timer<EOL><DEDENT>
When a Lambda function is executing, we setup certain interrupt handlers to stop the execution.
Usually, we setup a function timeout interrupt to kill the container after timeout expires. If debugging though,
we don't enforce a timeout. But we setup a SIGINT interrupt to catch Ctrl+C and terminate the container.

:param string function_name: Name of the function we are running
:param integer timeout: Timeout in seconds
:param samcli.local.docker.container.Container container: Instance of a container to terminate
:param bool is_debugging: Are we debugging?
:return threading.Timer: Timer object, if we setup a timer. None otherwise