Skip to content

Commit

Permalink
Upgrade rollback on timed out provisioning (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism authored Feb 3, 2024
1 parent d3c9924 commit 75f101c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/scripts/announce-restart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,15 @@ function serverShutdown(
standbyProvisioning = false;
}

// abort upgrade
if (
Date.now() - standbyCreateTime >
1000 * 60 * provisioningTimeout
) {
// remove stuck container
cp.execSync(`docker rm -f ${appName}`);
// rename 'old' container back to normal
cp.execSync(`docker rename ${oldAppName} ${appName}`);
throw new Error("Standby took too long to provision");
}

Expand Down

0 comments on commit 75f101c

Please sign in to comment.