Skip to content

Commit d167cd1

Browse files
committed
fix(node-upgrade): cycle s6-rc down→up on startNodes to fix upgrade restart
After FREEZE_COMPLETE the Hedera JVM exits with code 0. The finish script in the s6-rc container calls s6-svc -O so s6-supervise does not auto-restart. s6-rc still considers the service 'up', so issuing s6-rc -u change network-node was a no-op and the node never restarted after the upgrade, causing the checkAllNodesAreActive poll to time out. Add s6-rc -d before s6-rc -u so the service is explicitly cycled through down→up regardless of its prior state in s6-rc's state machine.
1 parent 900017f commit d167cd1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/commands/node/tasks.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,11 @@ export class NodeCommandTasks {
18641864
const startCommand: string = [
18651865
// Mark the service as intentionally enabled so s6-rc autostart picks it up on restart.
18661866
`touch ${constants.HEDERA_HAPI_PATH}/state/network-node.enabled`,
1867+
// Bring the service down first (idempotent). This is necessary for the upgrade
1868+
// restart case: after FREEZE_COMPLETE the JVM exits cleanly, but s6-rc still
1869+
// considers the service "up", so a plain s6-rc -u is a no-op and the node never
1870+
// restarts. Cycling through down→up forces s6-rc to re-launch the process.
1871+
'/command/s6-rc -d change network-node 2>/dev/null || true',
18671872
// Try s6-rc first (s6-overlay v3 with s6-rc service definition).
18681873
// Fall back to legacy s6-svc if the service is not registered in s6-rc
18691874
// (old container images using /etc/services.d/).

0 commit comments

Comments
 (0)