async def run_control_loop(self) -> None: while True: async with self.write_lock: try: self.http_state.update() except Exception: logger.exception("Exception updating HTTP state.") try: self.backend_state_manager.update() except Exception: logger.exception("Exception updating backend state.") self._put_serve_snapshot() await asyncio.sleep(CONTROL_LOOP_PERIOD_S)
async def run_control_loop(self) -> None: # NOTE(edoakes): we catch all exceptions here and simply log them, # because an unhandled exception would cause the main control loop to # halt, which should *never* happen. while True: try: self.autoscale() except Exception: logger.exception("Exception in autoscaling.") async with self.write_lock: try: self.http_state.update() except Exception: logger.exception("Exception updating HTTP state.") try: self.deployment_state_manager.update() except Exception: logger.exception("Exception updating deployment state.") try: self._put_serve_snapshot() except Exception: logger.exception("Exception putting serve snapshot.") await asyncio.sleep(CONTROL_LOOP_PERIOD_S)
async def run_control_loop(self) -> None: while True: try: self.autoscale() except Exception: logger.exception("Exception while autoscaling deployments.") async with self.write_lock: try: self.http_state.update() except Exception: logger.exception("Exception updating HTTP state.") try: self.deployment_state_manager.update() except Exception: logger.exception("Exception updating deployment state.") self._put_serve_snapshot() await asyncio.sleep(CONTROL_LOOP_PERIOD_S)