def _should_respawn_sensor(self, sensor_id, sensor, exit_code):
        """
        Return True if the provided sensor should be respawned, False otherwise.
        """
        if exit_code == 0:
            # We only try to respawn sensors which exited with non-zero status code
            return False

        respawn_count = self._sensor_respawn_counts[sensor_id]
        if respawn_count >= SENSOR_MAX_RESPAWN_COUNTS:
            LOG.debug("Sensor has already been respawned max times, giving up")
            return False

        return True

        Return True if the provided sensor should be respawned, False otherwise.
        
st2reactor/st2reactor/container/process_container.py