fix(connect): reboots no longer strand the relay link, 403s now say why #4988
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits into
main fromrefs/pull/4988/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- infra/relay/src/environments/EnvironmentConnector.ts lines 48 to 50OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -44,13 +45,6 @@4445 import * as RelayConfiguration from "../Config.ts";4546 import { isManagedEndpointHostname } from "../deploymentConfig.ts";464747-export const EnvironmentConnectNotAuthorizedReason = Schema.Literals([48- "client_proof_key_thumbprint_missing",49- "environment_link_not_found",50- "endpoint_provider_not_managed",51- "managed_endpoint_allocation_not_found",52- "managed_endpoint_base_domain_not_configured",53- "managed_endpoint_allocation_not_ready",54- "managed_endpoint_hostname_invalid",55- "managed_endpoint_mismatch",56-]);48+// The reason set is part of the public relay contract so clients can render49+// specific diagnostics (e.g. "your server never linked" vs. a real auth issue).50+export const EnvironmentConnectNotAuthorizedReason = RelayEnvironmentConnectNotAuthorizedReason;
- @@ -535,4 +537,19 @@535537 yield* Effect.forkScoped(536538 Effect.sleep("250 millis").pipe(537539 Effect.andThen(reconcileDesiredCloudLink(`http://127.0.0.1:${address.port}`)),538- Effect.retry({ times: 4 }),540+ // On reboot this races NIC/DNS bring-up, so back off exponentially541+ // (capped at 30s) instead of burning all retries in a second.542+ // Bounded overall so a permanently broken setup still surfaces the543+ // warning below. Bad-request/unauthorized are deterministic local544+ // failures that no amount of retrying converges.545+ Effect.retry({546+ while: (error) =>547+ error._tag !== "EnvironmentHttpBadRequestError" &&548+ error._tag !== "EnvironmentHttpUnauthorizedError",549+ schedule: Schedule.exponential("1 second").pipe(550+ Schedule.modifyDelay(({ duration }) =>551+ Effect.succeed(Duration.min(duration, Duration.seconds(30))),552+ ),553+ Schedule.upTo({ duration: "10 minutes" }),554+ ),555+ }),
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
fa640cdd-568f-4931-a7a9-8962027fda96You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share