INNER CODE UNIT · Python

_register_and_heartbeat

Soju06/codex-lb · app/main.py:784

    async def _register_and_heartbeat(svc: RingMembershipService, iid: str) -> None:
        attempt = 0
        while True:
            attempt += 1
            try:
                await _complete_bridge_registration(svc, iid)
                logger.info("Registered in bridge ring", extra={"instance_id": iid, "attempt": attempt})
                break
            except Exception:
                delay = min(5.0 * (2 ** min(attempt - 1, 5)), 60.0)
                logger.warning("Ring registration attempt %d failed, retrying in %.0fs", attempt, delay, exc_info=True)
                await asyncio.sleep(delay)
        await refresh_cap_partition(svc.list_active, iid)
        await _heartbeat_only(svc, iid)

    async def _activate_bridge_membership(svc: RingMembershipService, iid: str) -> None:
        if bridge_endpoint_base_url is None:
            await svc.register(iid, endpoint_base_url=None)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…