Skip to content

Commit 8ca46de

Browse files
committed
fix(server): the unit is repointed even when the committed child is gone
1 parent 66d773e commit 8ca46de

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/server/src/serviceLauncher.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,11 @@ export class Launcher {
846846
this.#state = next;
847847
child.role = "active";
848848
await discardDatabaseBackup(this.#baseDir, committed.id).catch(() => undefined);
849-
await sendMessage(child.process, { type: "committed", updateId: committed.id });
850-
await this.#repointServiceUnit(committed.targetVersion);
849+
try {
850+
await sendMessage(child.process, { type: "committed", updateId: committed.id });
851+
} finally {
852+
await this.#repointServiceUnit(committed.targetVersion);
853+
}
851854
}
852855

853856
// The commit is durable before this runs: a unit that could not be rewritten

0 commit comments

Comments
 (0)