
From a Five-Hour Outage to a Platform Shutdown: Splitting Your Node.js Recovery Plan in Two
On this page
One Recovery Plan Cannot Cover Both a Service Outage and a Platform Shutdown
A five-hour outage and a platform shutdown look similar from the dashboard and require completely different responses. This walkthrough splits Node.js recovery into two playbooks — one for bounded availability failures, one for exiting a platform you no longer trust — using the reported Microsoft disruption and Rackspace's security-driven Spot shutdown as prompts, with dependency inventories, adapter code, tests, and a rehearsal you can run on your own machine.
A temporary dependency failure calls for bounded degradation; a security-driven shutdown may require recovery outside the original trust boundary
These are different failure modes on different clocks. When Outlook, Teams, and AI services have been down for five-plus hours, the useful engineering question is "what does my service do while a dependency is unavailable?" When a provider shuts a platform down after a breach, the question shifts to "can I rebuild somewhere else without touching anything that might be compromised?"
Timeouts, breakers, fallbacks, and bounded queues answer the first. Portable artifacts, independently controlled credentials, and a restore path you've actually run answer the second. A single runbook.md that opens with "fail over to region B" answers neither, because it assumes the failing control plane is still the one you'll use to fix things.
Node.js teams need separate availability and platform-exit playbooks, connected by explicit escalation criteria
My position: treat availability and platform exit as two artifacts with two owners and two acceptance tests. They share one input — a dependency inventory — and one gate: a written escalation rule that says when you stop mitigating and start exiting. Everything past that gate is different work.
The practical consequence is that "we have a multi-cloud architecture" is not a recovery plan, and "we have hourly snapshots" is not a portability plan. What counts is whether someone has restored the data into a clean environment and served traffic from it while the original platform was unreachable.
What the Microsoft and Rackspace Reports Establish
Microsoft timeline: more than five hours of disruption affecting Outlook, Teams, and AI services, per DD News
DD News ran a report on 25 November 2026 describing a Microsoft outage that disrupted Outlook, Teams, and AI services for more than five hours. That is the claim the supplied material supports: a reported multi-hour disruption across several named services, with a stated duration, published on that date.
It doesn't state a root cause, doesn't say which regions or customer configurations were affected, and gives no start time, end time, or recovery curve.
Rackspace timeline: Spot cloud platform shut down after a security breach, per BleepingComputer
BleepingComputer published a report on 24 November 2026 saying Rackspace shut down its Spot cloud platform after a security breach. That is what the supplied material supports: a provider-initiated shutdown framed as following a security breach, published on that date.
It doesn't name the breach vector, the data involved, the notification timeline, or whether the shutdown is permanent. Those are open questions, not details to fill in.
Evidence limits: what the two reports do not say
| Question | Answer from supplied material |
|---|---|
| Root cause of the Microsoft disruption | Not stated |
| Exact outage window (start/end UTC) | Not stated |
| Which customers or tenants affected | Not stated |
| Root cause or vector of the Rackspace breach | Not stated |
| Whether customer data was exposed | Not stated |
| What restoration options exist for Spot customers | Not stated |
| Whether the Spot shutdown is permanent | Not stated |
Every architectural example below is therefore an example, not a reconstruction. When I write "if the runtime became unavailable," that's a hypothetical — not a reported fact about either incident.
Do not infer a general Azure outage, a shared cause, or a specific compromise mechanism
Three inferences to refuse explicitly:
- Not evidence of a platform-wide Azure failure. The report names specific services.
- Not evidence the two incidents share a cause, a vendor, or a bug class. They were published a day apart and that's the only connection the material supports.
- Not evidence of any particular compromise mechanism at Rackspace. "After a security breach" is the whole claim.
If your incident review starts by assuming a cause, you'll write a runbook for the incident you imagined. Write the runbook for the failure modes you can test, and let the postmortem tell you which one happened.
Build a Dependency Inventory That Supports Both Playbooks
Map one illustrative Node.js request path
Take a boring, realistic path: an authenticated POST /invoices in a Node.js API. Walking outward gives you the list of things that can end your day.
| Hop | What it is | Failure looks like | Exit looks like |
|---|---|---|---|
| Ingress | Load balancer, CDN, WAF | 502s, TLS errors | Re-point DNS at new ingress |
| Identity | OIDC provider, JWKS endpoint | Login impossible, token validation fails | New IdP, new client registration |
| Runtime | Node.js process, container platform | Crashloop, no scheduler | Deploy images to independent cluster |
| Database | PostgreSQL primary + replicas | Write failures, connection exhaustion | Restore dump into new cluster |
| Queue | Managed queue / broker | Backlog growth, duplicate delivery | Export, replay at controlled rate |
| Object storage | Bucket + signed URLs | Upload/download errors | Copy objects, re-sign with new keys |
| Notifications | Email/SMS provider | Silent non-delivery | Secondary provider, queued messages |
| AI assist | Third-party inference API | Slow, 429/503 | Disable the feature |
The AI row is deliberately last and deliberately optional. It's the cheapest thing to turn off, and it's also the most likely to be forgotten on the diagram because a feature flag added it six months after the architecture review.
Define a machine-readable inventory
Prose inventories rot. A file in the repo that CI validates doesn't.
{
"service": "ledger-api",
"dependencies": [
{
"name": "edge-dns",
"type": "control-plane",
"owner": "platform",
"criticality": "critical",
"timeoutBudgetMs": null,
"fallback": "none",
"dataClass": "public",
"rtoMinutes": 30,
"rpoMinutes": null,
"exitPath": "secondary-registrar",
"lastRestoreTested": null,
"recoveryCredentials": "vault:recovery/dns"
},
{
"name": "llm-assist",
"type": "runtime",
"owner": "ai-platform",
"criticality": "optional",
"timeoutBudgetMs": 700,
"fallback": "disable-feature",
"dataClass": "internal",
"rtoMinutes": null,
"rpoMinutes": null,
"exitPath": "openai-compatible-endpoint",
"lastRestoreTested": "2026-11-02",
"recoveryCredentials": "vault:recovery/llm"
},
{
"name": "ledger-db",
"type": "stateful",
"owner": "data-platform",
"criticality": "critical",
"timeoutBudgetMs": 2000,
"fallback": "none",
"dataClass": "restricted",
"rtoMinutes": 240,
"rpoMinutes": 15,
"exitPath": "",
"lastRestoreTested": null,
"recoveryCredentials": "vault:recovery/pg"
}
]
}Two fields carry most of the weight. lastRestoreTested is the difference between a backup policy and a backup. recoveryCredentials names where the credential lives — and if that path starts with the failing platform, you've found a circular dependency.
Find circular recovery dependencies
This is the failure mode that makes "we'll just fail over" collapse: the recovery path authenticates through the thing that's down.
| Recovery need | Hidden dependency | Cheap test |
|---|---|---|
| Redeploy the app | Container registry in the same account/tenant | Pull the pinned image digest from a mirror using separate credentials |
| Move DNS | Registrar login behind provider SSO | Log in to the registrar from a non-provider network |
| Restore the database | KMS key held in the affected tenant | Decrypt one backup in the recovery environment |
| Issue new credentials | IdP hosted on the affected platform | Create a break-glass admin from a sealed credential |
| Page on-call | Chat/status tool hosted on the platform | Send a test page from a phone on cellular data |
| Read the runbook | Wiki hosted on the platform | Keep a PDF export in the recovery repo |
The KMS row is the one teams get wrong most often. Encryption at rest isn't a portability feature unless the key is independently recoverable. A backup you can't decrypt is a file.
Add a Node.js inventory validator
The validator below is deliberately dumb: a handful of rules, no schema library, exit code 1 when something is blocking.
import { readFile } from "node:fs/promises";
const file = process.argv[2] ?? "dependencies.json";
const inventory = JSON.parse(await readFile(file, "utf8"));
const rules = [
{ id: "owner", applies: (d) => !d.owner, message: "missing owner" },
{
id: "fallback",
applies: (d) => d.criticality === "critical" && d.type !== "control-plane" && d.fallback === "none",
message: "critical dependency has no fallback",
},
{
id: "restore",
applies: (d) => d.criticality === "critical" && !d.lastRestoreTested,
message: "critical dependency has no tested restore (lastRestoreTested is null)",
},
{
id: "exit",
applies: (d) => d.criticality === "critical" && !d.exitPath,
message: "critical dependency has no exit path",
},
];
let blocking = 0;
const lines = [];
for (const dep of inventory.dependencies) {
for (const rule of rules) {
if (rule.applies(dep)) {
blocking += 1;
lines.push(" x " + dep.name.padEnd(20, ".") + " " + rule.message);
}
}
}
if (blocking > 0) {
console.log(inventory.service + ": " + blocking + " blocking issues across " + inventory.dependencies.length + " dependencies\n");
console.log(lines.join("\n"));
process.exitCode = 1;
} else {
console.log(inventory.service + ": " + inventory.dependencies.length + " dependencies validated, 0 blocking issues");
}Running it against the excerpt above:
$ node scripts/validate-inventory.mjs dependencies.json
ledger-api: 4 blocking issues across 3 dependencies
x edge-dns............ no tested restore (lastRestoreTested is null)
x ledger-db........... critical dependency has no fallback
x ledger-db........... no tested restore (lastRestoreTested is null)
x ledger-db........... critical dependency has no exit path
That output is the intended shape of the validator, not a captured production report. Three of the four findings land on the same dependency, which is exactly the pattern that makes a runbook fail in practice: one entry nobody finished filling in, and the restore path it was supposed to prove never existed. Wire this into CI as a required check so an inventory entry can't be added without an owner and an exit path.
Make lastRestoreTested a date, not a boolean. A boolean stays true forever; a date tells you when it expires.
Decide Which Playbook to Activate
Define separate recovery objectives
Two playbooks need two objective sets, because they optimize different things.
| Objective | Availability playbook | Exit playbook |
|---|---|---|
| RTO | Seconds to minutes, per feature | Hours to days, one-time |
| RPO | Whatever the durable queue holds | Last verified backup, minus accepted loss |
| Maximum degraded window | The business decision (five hours is a number to interrogate, not inherit) | Not applicable — exit is not time-boxed by uptime |
| Who approves | Incident commander | Incident commander plus security |
| Done when | Dependency healthy or feature safely off | Traffic served from a validated, independent environment |
The "maximum degraded window" row is the one most teams never write down. A reported five-hour disruption is a useful prompt: if a critical dependency vanished for five hours starting now, what would you tell customers at hour two, and what would be permanently lost?
Build a decision table for playbook selection
| Signal | Minimum evidence | Playbook | First action |
|---|---|---|---|
| Elevated latency/5xx from one dependency | Dashboards plus dependency owner confirmation | Availability | Shed optional features; let breaker open |
| Loss of control-plane access (cannot deploy, cannot read DNS) | Two independent operators reproduce it | Exit preparation | Freeze changes; retrieve artifacts out-of-band |
| Suspected credential compromise | Security lead assessment | Exit, then rebuild | Rotate from trusted hosts; preserve evidence |
| Provider announces shutdown with a date | Provider notice, ideally primary | Exit with deadline | Run the cutover rehearsal |
| Prolonged outage, no provider statement | Incident commander judgement | Prepare exit; do not cut over | Stage recovery env; keep serving degraded |
Preparing an exit is not authorizing cutover
This distinction is what keeps teams out of worse trouble. A four-hour outage justifies standing up a recovery environment, pulling images, and restoring a backup into isolation. It does not justify moving production traffic there, because you haven't established the original system is untrustworthy — only that it's slow.
Cutover changes the blast radius. It splits writes, invalidates sessions, and burns the old system's downtime budget while you debug a recovery path you may not have exercised. Require a named approver for cutover specifically, separate from the incident commander's authority to mitigate.
Assign responsibilities before automation changes infrastructure
| Role | Owns | Must not own |
|---|---|---|
| Incident commander | Playbook selection, comms cadence, degrade/cutover decision | Hands-on key rotation |
| Security approval | Trust assessment, evidence preservation, credential scope | Traffic routing |
| Recovery owner | Restore execution, validation queries, cutover mechanics | Deciding whether to cut over |
| Evidence custodian | Logs, snapshots, timeline, chain of custody | Any action on the affected system |
Automation is not a substitute for these roles. A pipeline that runs terraform apply in a recovery account without a named approver is a foot-gun with a nice UI.
Availability Playbook: Bound Dependency Failures in Node.js
A dependency adapter with explicit error classification
The point of an adapter is that callers don't see transport-level exceptions. They see a result with a known shape.
export class DependencyError extends Error {
constructor(kind, message, extra = {}) {
super(message);
this.name = "DependencyError";
this.kind = kind;
Object.assign(this, extra);
}
}
export function createLimiter(max, maxQueue = 32) {
let active = 0;
const waiters = [];
return async function withSlot(fn) {
if (active < max) {
active += 1;
} else if (waiters.length < maxQueue) {
await new Promise((resolve) => waiters.push(resolve));
} else {
throw new DependencyError("limiter", "local limiter queue full");
}
try {
return await fn();
} finally {
const next = waiters.shift();
if (next) next();
else active -= 1;
}
};
}
export function createBreaker({ failureThreshold = 3, resetTimeoutMs = 2000 } = {}) {
let state = "closed";
let failures = 0;
let openedAt = 0;
let probing = false;
return {
get state() {
return state;
},
allow() {
if (state === "closed") return true;
if (state === "open") {
if (Date.now() - openedAt < resetTimeoutMs || probing) return false;
probing = true;
state = "half-open";
return true;
}
return false;
},
success() {
failures = 0;
probing = false;
state = "closed";
},
failure() {
probing = false;
failures += 1;
if (state === "half-open" || failures >= failureThreshold) {
state = "open";
openedAt = Date.now();
}
},
};
}
function classify(err) {
if (err && err.name === "TimeoutError") return "timeout";
if (err && err.name === "AbortError") return "cancelled";
if (err && err.kind === "limiter") return "overloaded";
if (err && err.kind === "http") return "http-" + err.status;
if (err instanceof TypeError) return "network";
return "unknown";
}
function degraded(reason) {
return { degraded: true, reason, summary: null, sdk: null };
}
export function createAdapter({
endpoint,
timeoutMs = 700,
failureThreshold = 3,
resetTimeoutMs = 2000,
maxConcurrent = 4,
}) {
const limiter = createLimiter(maxConcurrent);
const breaker = createBreaker({ failureThreshold, resetTimeoutMs });
async function call(text, budgetMs, scopeSignal) {
const signal = AbortSignal.any([AbortSignal.timeout(budgetMs), scopeSignal]);
const res = await fetch(endpoint, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ text }),
signal,
});
if (!res.ok) {
throw new DependencyError("http", "upstream status " + res.status, {
status: res.status,
retryAfter: res.headers.get("retry-after"),
});
}
return res.json();
}
async function summarize(text, { deadline }) {
const budget = Math.min(timeoutMs, deadline.remaining());
if (budget <= 0) return degraded("deadline-exhausted");
if (!breaker.allow()) return degraded("open-circuit");
try {
const body = await limiter(() => call(text, Math.min(budget, deadline.remaining()), deadline.signal));
breaker.success();
return { degraded: false, reason: null, ...body };
} catch (err) {
// Local saturation is not a dependency failure and must not trip the breaker.
if (!err || err.kind !== "limiter") breaker.failure();
return degraded(classify(err));
}
}
return { summarize, breaker };
}Three details worth defending:
AbortSignal.anycombines the per-dependency budget with the request-scoped signal, so a client disconnect cancels the upstream call. This needs Node.js 20 or newer; on older runtimes you need a manualaddEventListener("abort", ...)bridge.classifydistinguishesTimeoutError(our budget) fromAbortError(caller gave up). Different incidents; they should page differently.- The limiter's
limiterkind is excluded frombreaker.failure(). A full local queue means you are the problem, not upstream — counting it would open the breaker during a traffic spike and take a healthy dependency out of service.
Allocate one end-to-end deadline
The deadline is request-scoped, not dependency-scoped.
export function createDeadline(totalMs) {
const deadlineAt = Date.now() + totalMs;
const controller = new AbortController();
const timer = setTimeout(() => {
controller.abort(new DOMException("request deadline exceeded", "TimeoutError"));
}, totalMs);
timer.unref?.();
return {
signal: controller.signal,
remaining: () => Math.max(0, deadlineAt - Date.now()),
dispose() {
clearTimeout(timer);
},
};
}If a handler calls four dependencies and each independently applies a 700 ms timeout, worst case is 2.8 seconds of latency while the client's own timeout is 1.5 seconds. The user sees a failure; you see four "successful" slow calls in the trace. Budget the request, then let each dependency spend what's left.
Retries: safe operations only, capped backoff, one layer
async function readWithRetry(url, { signal, attempts = 2, baseMs = 100 }) {
for (let i = 0; i < attempts; i += 1) {
const res = await fetch(url, { method: "GET", signal }); // safe: read-only
if (res.ok) return res;
if (res.status !== 429 && res.status < 500) return res;
if (i === attempts - 1) return res;
const retryAfter = Number(res.headers.get("retry-after"));
const backoff = Number.isFinite(retryAfter)
? retryAfter * 1000
: Math.min(baseMs * 2 ** i, 2000) * (0.5 + Math.random());
await new Promise((resolve) => setTimeout(resolve, backoff));
}
}
Three rules this encodes:
- Only retry idempotent operations. Retrying a non-idempotent
POSTwithout an idempotency key is how you double-charge a customer. - Cap and jitter. Uncapped exponential backoff plus synchronized retries is a self-inflicted DDoS with a fixed schedule.
- One retry layer. If the SDK retries three times and your adapter retries twice, that's six attempts per user request. Pick a layer — usually the outermost one that knows the deadline — and disable the other.
Circuit breaker and concurrency limit
A breaker and a limiter solve different problems. The limiter keeps you from exhausting your own event loop, sockets, and memory on calls that won't succeed. The breaker keeps you from paying the timeout on every request once you already know the answer.
Breaker state is not dependency health. open means "we stopped trying", half-open means "one probe is in flight", closed means "we're trying again". A dependency can recover while your breaker stays open until resetTimeoutMs elapses, and a dependency can be fine while your breaker is open because of one bad error classification. Export breaker state as its own metric and never label it dependency_up.
Availability Playbook: Degrade Features Without Breaking Security or Data Integrity
Concrete fallbacks for optional features
- AI assist: return
{ degraded: true, reason: "timeout", summary: null }and let the UI hide the panel. Don't return another user's stale summary or a truncated one — a partially correct AI answer is worse than an absent one. - Notifications: don't send "your receipt is ready" twice because the first attempt timed out after the provider accepted it. Write the notification to a durable outbox in the same transaction as the business change, and let a worker deliver it. If the queue itself is down, reject the write with a clear pending state rather than accepting it silently.
- Recommendations/search: swap in a cached or unfiltered-but-safe list, and mark the response so the UI can say results are limited.
Identity degradation is different: never add a skip-auth path
Don't add an emergency "skip auth" path. Verify this list instead:
- Existing, already-validated sessions may continue under your current verification policy — for example, if your session cookie carries a signed session with an expiry you control, you don't need the IdP per request.
- Token validation against cached JWKS keys can continue until cache expiry; that's a documented property of the key cache, not a bypass.
- New logins, new client registrations, and password/step-up flows fail closed.
- Never accept an unsigned token "because the IdP is down." That's the exact moment an attacker is watching.
Liveness, readiness, and feature health are three different signals
| Probe | Question | Should fail when |
|---|---|---|
| Liveness | Is this process wedged? | Event loop blocked, deadlock |
| Readiness | Should this instance receive traffic? | Database pool exhausted, migration mismatch |
| Feature health | Can this feature serve correctly? | Optional dependency degraded |
Putting an optional dependency into the readiness probe is the classic mistake: the AI provider has a bad hour, every pod fails readiness, the orchestrator restarts them all, and a degraded feature becomes a full outage. Keep optional dependencies out of both probes and expose feature health on a separate endpoint that feeds dashboards and UI flags, not the scheduler.
Preserve write semantics
- Idempotency keys on every externally triggered write, stored with the response so a replay returns the original result.
- Transactional outbox when a write must also produce a message: insert the business row and the outbox row in one transaction, then publish from the outbox.
- Bounded queue growth with an explicit rejection threshold. An unbounded queue turns an outage into a data-loss event when the pod is evicted.
- Explicit pending states in the API and UI.
202 Acceptedwith a status URL beats a200that lied.
Reproduce an Availability Failure in a Local Node.js Lab
A loopback-only mock dependency
import { createServer } from "node:http";
export function startMock({ port = 0 } = {}) {
let failuresLeft = 0;
let requests = 0;
let inFlight = 0;
let peakInFlight = 0;
const server = createServer((req, res) => {
const url = new URL(req.url, "http://127.0.0.1");
if (url.pathname === "/stats") {
res.writeHead(200, { "content-type": "application/json" });
res.end(JSON.stringify({ requests, peakInFlight }));
return;
}
if (url.pathname === "/failures") {
failuresLeft = Number(url.searchParams.get("count") ?? 0);
res.writeHead(204).end();
return;
}
if (url.pathname !== "/dependency/summarize") {
res.writeHead(404).end();
return;
}
requests += 1;
const mode = url.searchParams.get("mode") ?? "healthy";
if (mode === "disconnect") {
req.socket.destroy();
return;
}
if (mode === "503") {
res.writeHead(503, { "retry-after": "1" }).end("unavailable");
return;
}
inFlight += 1;
peakInFlight = Math.max(peakInFlight, inFlight);
const delayMs = mode === "delayed" ? Number(url.searchParams.get("delay") ?? 1500) : 20;
setTimeout(() => {
inFlight -= 1;
if (failuresLeft > 0) {
failuresLeft -= 1;
res.writeHead(500).end("synthetic failure");
return;
}
res.writeHead(200, { "content-type": "application/json" });
res.end(JSON.stringify({ summary: "mock summary", sdk: "mock-1.0" }));
}, delayMs);
});
return new Promise((resolve) => {
server.listen(port, "127.0.0.1", () => {
const address = server.address();
resolve({
url: "http://127.0.0.1:" + address.port,
close: () => new Promise((done) => server.close(done)),
});
});
});
}
if (import.meta.url === "file://" + process.argv[1]) {
const mock = await startMock({ port: 4010 });
console.log("mock listening on " + mock.url);
}The server binds to 127.0.0.1 only. Nothing here reaches a real provider, and disconnect destroys the socket instead of returning an error — which is what a mid-flight network partition actually looks like.
Tests with the Node.js test runner
import test from "node:test";
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
async function withLab(fn) {
const mock = await startMock();
try {
await fn(mock);
} finally {
await mock.close();
}
}
async function run(adapter, deadlineMs = 1000) {
const deadline = createDeadline(deadlineMs);
try {
return await adapter.summarize("hello", { deadline });
} finally {
deadline.dispose();
}
}
test("healthy dependency returns a non-degraded result", async () => {
await withLab(async (mock) => {
const adapter = createAdapter({ endpoint: mock.url + "/dependency/summarize?mode=healthy" });
const result = await run(adapter);
assert.equal(result.degraded, false);
assert.equal(result.sdk, "mock-1.0");
});
});
test("a slow dependency is cut off by the adapter budget", async () => {
await withLab(async (mock) => {
const adapter = createAdapter({
endpoint: mock.url + "/dependency/summarize?mode=delayed&delay=1500",
timeoutMs: 300,
});
const started = Date.now();
const result = await run(adapter, 5000);
const elapsed = Date.now() - started;
assert.equal(result.degraded, true);
assert.equal(result.reason, "timeout");
assert.ok(elapsed >= 280 && elapsed < 900, "elapsed=" + elapsed);
});
});
test("breaker opens after the threshold and stops calling the dependency", async () => {
await withLab(async (mock) => {
const adapter = createAdapter({
endpoint: mock.url + "/dependency/summarize?mode=healthy",
failureThreshold: 3,
});
await fetch(mock.url + "/failures?count=99");
const reasons = [];
for (let i = 0; i < 5; i += 1) reasons.push((await run(adapter)).reason);
assert.deepEqual(reasons, ["http-500", "http-500", "http-500", "open-circuit", "open-circuit"]);
assert.equal(adapter.breaker.state, "open");
const stats = await (await fetch(mock.url + "/stats")).json();
assert.equal(stats.requests, 3);
});
});
test("concurrency limit keeps in-flight calls at the cap", async () => {
await withLab(async (mock) => {
const adapter = createAdapter({
endpoint: mock.url + "/dependency/summarize?mode=delayed&delay=120",
maxConcurrent: 4,
timeoutMs: 3000,
});
await Promise.all(Array.from({ length: 20 }, () => run(adapter, 6000)));
const stats = await (await fetch(mock.url + "/stats")).json();
assert.ok(stats.peakInFlight <= 4, "peak=" + stats.peakInFlight);
});
});
test("half-open probe closes the breaker after recovery", async () => {
await withLab(async (mock) => {
const adapter = createAdapter({
endpoint: mock.url + "/dependency/summarize?mode=healthy",
failureThreshold: 3,
resetTimeoutMs: 100,
});
await fetch(mock.url + "/failures?count=3");
for (let i = 0; i < 3; i += 1) await run(adapter);
assert.equal(adapter.breaker.state, "open");
assert.equal((await run(adapter)).reason, "open-circuit");
await sleep(150);
const probe = await run(adapter);
assert.equal(probe.degraded, false);
assert.equal(adapter.breaker.state, "closed");
});
});$ node --test lab/
## tests 5
## pass 5
## fail 0
That summary is the expected result of the assertions above, not a captured CI run from a production system. Every assertion is deterministic except the elapsed-time window, which is deliberately loose (280–900 ms) so it survives a loaded laptop.
curl checks against the running lab
$ node lab/mock-dependency.js &
$ MOCK=http://127.0.0.1:4010
$ curl -s "$MOCK/dependency/summarize?mode=healthy"
{"summary":"mock summary","sdk":"mock-1.0"}
$ curl -s -o /dev/null -w '%{http_code}\n' "$MOCK/dependency/summarize?mode=503"
503
$ curl -s -D - -o /dev/null "$MOCK/dependency/summarize?mode=503" | grep -i retry-after
retry-after: 1
$ curl -s "$MOCK/dependency/summarize?mode=disconnect"; echo "exit=$?"
exit=52
$ curl -s "$MOCK/stats"
{"requests":3,"peakInFlight":1}
exit=52 is curl's "empty reply from server" — the socket was destroyed, which is the point. Expected output for the healthy/degraded/recovered progression through the adapter:
| Scenario | degraded | reason | Breaker after |
|---|---|---|---|
| Healthy | false | null | closed |
| Delayed beyond budget | true | timeout | closed (1 failure) |
| Repeated 500s | true | http-500 | open after threshold |
After resetTimeoutMs | false | null | closed |
Duplicate delivery and backlog recovery
test("duplicate delivery with the same idempotency key creates one record", async () => {
const outbox = createMemoryOutbox();
await outbox.enqueue({ key: "req-1", payload: { amount: 100 } });
await outbox.enqueue({ key: "req-1", payload: { amount: 100 } });
assert.equal(outbox.size(), 1);
});
The second half of that test matters more than the first: after a 40-minute outage, your queue holds 40 minutes of work. Releasing it at full speed against a just-recovered dependency is a second outage with your name on it. Drain at a fixed rate with a token bucket, and stop when the breaker opens again:
async function drainAtRate(queue, deliver, { perSecond, batchSize = 10 }) {
const intervalMs = 1000 / perSecond;
while (queue.size() > 0) {
const started = Date.now();
const batch = queue.take(batchSize);
await Promise.all(batch.map(deliver));
const elapsed = Date.now() - started;
if (elapsed < intervalMs) await new Promise((r) => setTimeout(r, intervalMs - elapsed));
}
}
Platform-Exit Playbook: Rebuild Outside the Original Trust Boundary
Start from the Rackspace report without inventing its details
The supplied material says Rackspace shut Spot down after a security breach. It doesn't say the breach reached customer workloads, that customer data was exposed, or that the shutdown is permanent. So the exercise is conditional: if a provider's runtime and management plane went unavailable at the same time, what would you need?
That framing isn't hypothetical hand-waving. It's the only framing the evidence supports, and it produces a testable checklist.
Separate portable artifacts from provider-specific infrastructure
| Artifact | Portable form | Provider-specific trap |
|---|---|---|
| Runtime | Pinned node version in .nvmrc + engines | Managed buildpack that silently upgrades |
| Dependencies | Committed lockfile, npm ci | Registry proxy with private auth only |
| Application | Image by digest, plus a source archive | Image tag resolved from provider registry |
| Config | Validated schema + versioned config repo | Console-only environment variables |
| Infrastructure | IaC with parameterized provider blocks | Hand-edited console resources |
| Secrets | References resolved at deploy from a separate vault | Secrets baked into provider secret store only |
Two habits that make the difference: deploy by image digest (app@sha256:...), not a mutable tag, and keep a source archive plus lockfile outside the provider. A digest you can only resolve from the failing registry isn't an artifact you own.
Pre-stage an independent recovery environment
Independence has to be structural, not declarative:
- Identity: separate IdP tenant, or a break-glass admin with credentials stored offline and rotated on use.
- Deployment access: CI credentials the affected platform can't revoke, in a separate account, with a tested permission set.
- Registry access: a mirror with its own credentials, holding the digests you would deploy.
- DNS administration: registrar access not gated behind the provider's SSO.
- Incident communications: a status page and channel that don't run on the platform you're recovering from.
You don't need a warm standby for all of this. You need credentials that work and one documented path. That cost is small; discovering during an incident that your break-glass account federates through the broken IdP is not.
Treat suspected compromise as a trust problem
If credentials might be exposed, the recovery environment is not "the same thing somewhere else" — it's a rebuild with new trust anchors.
- Preserve evidence first. Snapshot the affected environment read-only if the provider still offers it, and record what you captured and when. Don't delete anything to "clean up".
- Don't copy secrets out of the affected environment. Not to save time, not "just the database password". Those credentials are presumed disclosed.
- Issue replacements from trusted systems — the independent vault, the independent IdP — and rotate service-to-service credentials, signing keys, and webhook secrets.
- Deploy from artifacts you trust: source you can rebuild plus digests verified against something other than the compromised registry.
- Re-register external integrations. Webhook secrets, OAuth client secrets, and payment provider keys all need re-issuing, because the old ones may be in an attacker's notes.
Make Data Portable, Consistent, and Safe to Restore
PostgreSQL as an explicit walkthrough example
PostgreSQL is used here because it's the common case and its tooling makes the tradeoffs visible. Both reported incidents are silent on databases, so nothing below is a claim about Microsoft's or Rackspace's internals.
Logical backups (pg_dump) travel well: they produce SQL or a custom archive that a different PostgreSQL major version can ingest, with no dependency on the provider's storage format. Physical backups and PITR give you a much better RPO but tie you to a compatible engine version, a WAL archive, and often provider tooling. Snapshot-only strategies have a specific trap — an hourly snapshot gives you an RPO of "up to an hour", and if the compromise predates your oldest retained snapshot, your entire snapshot set is untrusted.
Scoped pg_dump and pg_restore against disposable databases
## 1) Dump from the source, custom format, no ownership or ACL coupling.
$ export SOURCE_URL="postgresql://[email protected]:5432/ledger"
$ pg_dump --format=custom --compress=9 --no-owner --no-privileges \
--file=ledger-2026-11-24.dump "$SOURCE_URL"
## 2) Global objects travel separately.
$ pg_dumpall --globals-only --no-role-passwords --file=ledger-globals.sql "$SOURCE_URL"
## 3) Checksum before it leaves the host, then encrypt.
$ sha256sum ledger-2026-11-24.dump | tee ledger-2026-11-24.sha256
7f2c... ledger-2026-11-24.dump
$ age -r age1recovery... -o ledger-2026-11-24.dump.age ledger-2026-11-24.dump
## 4) Restore into a disposable database, never over the source.
$ createdb -h 127.0.0.1 -p 5433 ledger_restore_test
$ pg_restore --dbname="postgresql://[email protected]:5433/ledger_restore_test" \
--no-owner --no-privileges --exit-on-error --verbose \
ledger-2026-11-24.dump
Note what's missing from step 4: --clean, --if-exists, and any reference to the production connection string. Restoration is always into a new database, and the dump is never applied in place.
--format=directory --jobs=4 parallelizes a large dump at the cost of producing a directory instead of a single file. pg_dump takes a consistent snapshot within one database — which is why step 2 exists for globals — but doesn't give you consistency across databases, buckets, or queues.
Inventory state beyond SQL: objects, queues, jobs, and keys
| State | Export mechanism | Consistency caveat |
|---|---|---|
| SQL rows | pg_dump, PITR | Snapshot per database |
| Object versions | Object-store versioned copy | Copied after the SQL dump; may include newer writes |
| Queue contents | Broker export or drain-to-cold-storage | In-flight messages are the hardest part |
| Scheduled jobs | IaC / job definition export | Cron drift is invisible until restored |
| Configuration | Versioned config repo | Exported at a different time than the data |
| Encryption keys | Independent KMS, escrowed | Must be recoverable without the provider |
None of these exports share a transaction boundary. Two exports taken five minutes apart don't form a consistent recovery point, and pretending they do creates referential failures that only appear when the restored app runs its first integrity query.
Integrity is not trust
A SHA-256 checksum proves the bytes didn't change between dump and restore. It proves nothing about whether the dump was taken before an intruder modified the data. Separate questions, separate evidence:
- Integrity: checksums,
pg_restore --exit-on-error, constraint validation. - Trust: timeline evidence, security review, and a documented decision about which recovery point predates the suspected compromise.
If the earliest trusted evidence is "the intrusion was detected on 24 November", the only defensible recovery point may be several days older than your most recent backup. That's a data-loss decision, and it belongs to the security lead and the business owner, not to the on-call engineer running pg_restore.
Restore into isolation and validate
-- schema and application version
select version();
select * from schema_migrations order by version desc limit 1;
-- row counts against pre-incident baselines
select 'invoices' as t, count(*) from invoices
union all select 'payments', count(*) from payments
union all select 'outbox', count(*) from outbox where published_at is null;
-- constraints that a partial restore would violate
select conrelid::regclass as tbl, conname
from pg_constraint
where contype = 'f' and convalidated = false;
Then run the application against the restored database with traffic disabled and side effects off. A restoration that passes every SQL check but fails the first application query isn't a restoration.
Rehearse Exit and Cutover Without Creating Split-Brain Writes
Run the application with real-world side effects disabled
export const recoveryMode = process.env.RECOVERY_MODE === "true";
export const sideEffects = {
email: !recoveryMode,
sms: !recoveryMode,
payments: !recoveryMode,
outboundWebhooks: !recoveryMode,
thirdPartyPushes: !recoveryMode,
};
if (recoveryMode && process.env.NODE_ENV === "production") {
throw new Error("recovery mode must not run with production side effects enabled");
}Two things to check in a rehearsal: that the guard actually throws when misconfigured, and that no code path bypasses sideEffects (grepping for direct fetch calls to provider endpoints is crude but effective).
Define the final write fence and reconciliation
An exit drill that never stops writes is a load test, not a recovery exercise. The sequence:
- Announce the fence and set the app to reject new writes at the edge.
- Wait for in-flight writes to drain, with a bounded timeout.
- Take the final export or record the replication LSN (
select pg_current_wal_lsn();on the source). - Export queue contents and mark the queue paused rather than deleting it.
- Restore, then reconcile: compare counts and checksums for the affected window, and list any records accepted after the fence.
- Document accepted loss explicitly — the number, not "minimal".
A note on replicas: a streaming replica protects you from a host failure. It doesn't protect you from a compromise, because it faithfully replicates the attacker's writes and, in most setups, an attacker with control-plane access can reach it. Asynchronous replication is an availability tool being asked to do a security job.
Traffic switching has more limits than a routing change
| Limit | Why it outlasts the switch | Mitigation |
|---|---|---|
| DNS caching | Resolver TTLs, ISP caching | Low TTL well in advance; have a fallback path |
| Existing connections | Long-lived keep-alives, HTTP/2 sessions | Drain and connection age limits |
| TLS certificates | New hostname needs issuance and validation | Pre-provision certs in the recovery env |
| Callback registrations | OAuth redirect URIs, webhook URLs registered upstream | Pre-register the recovery hostname |
| Upstream allowlists | Partner firewalls list your old egress IPs | Request additions during the drill |
| Session state | Cookies scoped to the old domain | Plan re-auth; do not weaken cookie policy to avoid it |
The webhook row is underrated. A payment provider that only calls https://api.example.com/webhooks will keep calling the old host after your DNS change if its own DNS cache differs from yours — or will fail validation if the secret rotated.
Rollback prerequisites
You can roll back to the original environment only if all of these are true:
- The original environment's trust has been re-established (patching, re-imaging, credential rotation).
- The recovery environment's writes have been exported and applied back — otherwise rollback is data loss.
- The original environment can accept the schema version now deployed.
- Someone with authority has accepted the risk in writing.
If trust hasn't been re-established, rollback isn't on the table. Traffic returns forward-only, to a third clean environment or the existing recovery one. Write that down before the incident, because in the incident someone will ask "can we just switch back?" and the answer needs to be policy, not debate.
Record drill evidence
| Metric | Why it matters |
|---|---|
| Time to first successful restore | The real RTO, not the advertised one |
| Achieved recovery point | Timestamp of the restored data vs. the fence |
| Missing dependencies found | Each one is a hidden production dependency |
| Credential failures | Count and cause; these are the exit blockers |
| Reconciliation deltas | Records +/-, accepted loss |
| Manual steps | Anything not scripted will be slower at 3 a.m. |
A drill report showing "RTO: 4h 12m, 6 credential failures, 1 missing bucket policy" is more valuable than one showing "success". The failures are the backlog.
Turn the Two Case Studies into Separate Acceptance Tests
Microsoft-style availability exercise: a five-hour dependency interruption
Simulate a five-hour interruption of one critical dependency and one optional dependency. During the window, verify:
- p95 latency stays within the request deadline; no request exceeds it because of stacked timeouts.
- Optional features (AI assist, recommendations) return a documented degraded shape within the feature budget.
- Authentication still works for existing sessions and fails closed for new logins.
- The durable backlog grows but never exceeds its cap, and the cap produces a visible rejection rather than silent loss.
- Breaker metrics open and close on the expected schedule, and recovery probing doesn't slam the dependency.
Rackspace-style exit exercise: recover with zero trust in the original platform
Take the original runtime and control plane unavailable. Assume every credential issued by that environment is untrusted. Recover using only independently held artifacts:
- Pull images by digest from the mirror with separate credentials.
- Restore the database into an isolated cluster from an encrypted dump and an independently escrowed key.
- Issue replacement credentials from the independent IdP and vault.
- Serve traffic from the recovery environment with side effects enabled only after validation.
- Produce a reconciliation report with an explicit accepted-loss number.
Measurable pass criteria
| Criterion | Availability exercise | Exit exercise |
|---|---|---|
| Bounded latency | No request exceeds the deadline | Not applicable |
| Feature degradation | Documented response shape per feature | Feature set may be reduced |
| Request isolation | Unavailable dependency consumes ≤ N slots | Not applicable |
| Independent restoration | Not required | Demonstrated from dump + independent key |
| Credential replacement | Not required | All replacement credentials issued from trusted systems |
| Data validation | Backlog replay integrity | Constraint checks, invariants, application smoke |
| Evidence | Breaker/latency timeline | Drill report with deltas |
The architectural decision
Prioritize tested recovery independence over nominal portability. A single-region deployment with a rehearsed pg_dump-restore, an independent vault, and a working break-glass admin is more resilient than a two-cloud Terraform setup nobody has applied in anger. The multi-cloud diagram is a claim; the drill report is evidence.
Concretely, this week:
- Write
dependencies.jsonfor one service and wire the validator into CI as a required check. - Implement the adapter with a request-scoped deadline and exclude local-saturation errors from the breaker.
- Move optional dependencies out of readiness probes.
- Run one restore drill into a disposable database and record the duration and deltas.
- Verify two exit credentials work from outside the provider's network.
None of that requires a five-hour outage to test — which is the point. The reported incidents tell you the failure modes are real; your drill determines whether your recovery path is.
Further Reading and Incident Evidence
Supplied reporting (secondary sources)
- Microsoft outage disrupts Outlook, Teams and AI services for over five hours — DD News, published 25 November 2026. Aggregator link; the source is secondary reporting.
- Rackspace shuts down Spot cloud platform after security breach — BleepingComputer, published 24 November 2026. Aggregator link; the source is secondary reporting.
Primary incident documentation
Not available in the supplied material. I didn't locate or verify a Microsoft incident notice or a Rackspace advisory for these events, so none is linked here. If you need root cause, timeline, or data-exposure specifics, those primary documents are the thing to find — and until you have them, treat every mechanism described above as a testable hypothesis, not a reported fact.
Documentation supporting the walkthrough
- Node.js globals:
fetch— the built-in Fetch API implementation and its availability. - Node.js globals:
AbortSignal—AbortSignal.timeout()andAbortSignal.any()semantics used by the adapter. - Node.js test runner —
node:test, which the lab uses instead of an external framework. - PostgreSQL
pg_dump— formats,--format=directory, and snapshot behavior. - PostgreSQL
pg_restore— selective restore and--exit-on-error. - PostgreSQL continuous archiving and PITR — what you need beyond logical dumps for a tighter RPO.
More posts

Detecting and Virtually Patching WordPress CVE-2026-87902 with a Node.js Triage Script
A hands-on guide to building a Node.js triage script that fingerprints vulnerable WordPress installs, applies virtual patching for CVE-2026-87902, and hunts for post-exploitation webshells after attackers began exploiting the critical RCE within hours of the patch release.

Finding Chromium-Only Assumptions in Your Frontend with Ladybird's Alpha
Ladybird's first alpha on macOS and Linux gives frontend teams a practical way to audit accidental Chromium dependencies through standards-based feature detection, progressive enhancement, and deliberate compatibility testing.

Model Size Is Not Agent Viability: Benchmarking PrismML's 5.9GB 27B-Class Artifact
PrismML's 5.9GB 27B-class artifact is a striking compression claim, but a reproducible benchmark spanning peak runtime memory, usable context, tool-call accuracy, latency, and cost per completed agent task shows why file size alone cannot establish local agent viability.
Loading comments…