Files
orca/cloud/dev/scripts/relay-load-run-lifecycle.mjs
T
Jinwoo Hong 3eec77c11a chore(cloud): add the relay fence broker, ops console, Terraform root, scripts, and 24 cloud-* workflows (#18413)
Phase 6 of the relay split: the relay's deploy/operate surface moves under cloud/ with 24 cloud-* workflows gated on ORCA_CLOUD_OPERATIONS_ENABLED, the Cloud SQL rollout lease action, the relay Terraform root (dual-accept identities for both repositories), scripts, docs, CODEOWNERS, and a terraform validate job in Cloud Verify.
2026-09-03 06:55:14 -04:00

26 lines
800 B
JavaScript

export function assertRelayLoadRampAccepted(rampConnectionFailures, maximum) {
if (rampConnectionFailures > maximum) {
throw new Error('relay load ramp exceeded the allowed connection failures')
}
}
export async function runRelayLoadWithShutdown(operation, shutdown) {
try {
return await operation()
} finally {
await shutdown()
}
}
export function relayLoadRunHasDisallowedFailures(result, config) {
return (
result.rampConnectionFailures > config.maxRampConnectionFailures ||
(!config.allowPlannedTransitionRetries && result.transitionConnectionFailures > 0) ||
result.steadyConnectionFailures > 0 ||
result.unexpectedCloses > config.maxUnexpectedCloses ||
result.protocolErrors > 0 ||
result.refreshErrors > 0 ||
result.socketErrors > 0
)
}