An open-source, faster Devin alternative
TypeScript
vector: bump populator poll to 600s + add ExecStartPost vector restart (#257)
Mohamed Habib213e8e6076d1
diff --git a/deploy/vector/populate-vector-env.service b/deploy/vector/populate-vector-env.serviceindex a24069a9..6c6766ec 100644--- a/deploy/vector/populate-vector-env.service+++ b/deploy/vector/populate-vector-env.service@@ -44,6 +44,14 @@ Type=oneshotEnvironmentFile=-/etc/opensandbox/worker.envEnvironmentFile=-/etc/opensandbox/server.envExecStart=/usr/local/bin/populate-vector-env.sh+# On prod, vector.service may have started at boot before worker.env+# arrived and entered failed state via Restart=always/StartLimit hit.+# Once populator's 600s poll lands the env file and writes vector.env,+# reset-failed + restart brings vector back. `-` prefix ignores+# errors (vector may not be installed in some packer-bake paths).+# `--no-block` avoids deadlock on vector's After=this-service.+ExecStartPost=-/bin/systemctl --no-block reset-failed vector.service+ExecStartPost=-/bin/systemctl --no-block restart vector.serviceRemainAfterExit=yes# Retry a few times if KV is briefly unreachable at boot. The script# itself exits 0 on graceful failure paths (no IMDS, no secret, etc.) sodiff --git a/deploy/vector/populate-vector-env.sh b/deploy/vector/populate-vector-env.shindex 0176b07e..a5ad4646 100755--- a/deploy/vector/populate-vector-env.sh+++ b/deploy/vector/populate-vector-env.sh@@ -68,8 +68,16 @@ log() { logger -t populate-vector-env "$*"; echo "$*"; }# 00:43:08 and 00:43:10, worker.env written at 00:44 — too late.## Poll inside the script instead: single systemd invocation, internal-# wait of up to 90s. No restart-budget interaction.-DEADLINE=$(($(date +%s) + 90))+# wait. No restart-budget interaction.+#+# 600s (10 min) — #256 used 90s and gave up too early. Observed on+# osb-worker-0b42c8be: cloud-init wrote worker.env at +4m into boot,+# our 90s poll already ended at +90s. Vector was started without an+# env, failed-restart-looped into a `failed` state, and worker.env+# arriving later didn't help. Azure cloud-init can take 3-5 min on+# Standard_D-series VMs; 10 min covers the observed long tail with+# margin. If something exceeds 10 min, the host is broken anyway.+DEADLINE=$(($(date +%s) + 600))while [ $(date +%s) -lt $DEADLINE ]; doif [ -f /etc/opensandbox/worker.env ] || [ -f /etc/opensandbox/server.env ]; thenbreak@@ -87,7 +95,7 @@ doneVAULT_NAME="${OPENSANDBOX_AZURE_KEY_VAULT_NAME:-}"if [ -z "$VAULT_NAME" ]; then- log "OPENSANDBOX_AZURE_KEY_VAULT_NAME still unset after 90s wait — host genuinely has no KV configured (e.g. dev VM without managed identity); skipping (Vector will start without a token)"+ log "OPENSANDBOX_AZURE_KEY_VAULT_NAME still unset after 600s wait — host genuinely has no KV configured (e.g. dev VM without managed identity); skipping (Vector will start without a token)"exit 0fi