Skip to content

Commit 13cbb1c

Browse files
committed
roachprod: add burst and interval limit to auto restart
Adding burst and interval limit to auto restart in order to prevent an infinite restart (crash) loop, Epic: None Release note: None
1 parent 6169bc0 commit 13cbb1c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/roachprod/install/scripts/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ sudo systemd-run --unit "${VIRTUAL_CLUSTER_LABEL}" \
103103
-p "MemoryMax=${MEMORY_MAX}" \
104104
-p LimitCORE=infinity \
105105
-p "LimitNOFILE=${NUM_FILES_LIMIT}" \
106-
${AUTO_RESTART:+-p Restart=always -p RestartSec=5s} \
106+
${AUTO_RESTART:+-p Restart=always -p RestartSec=5s -p StartLimitIntervalSec=60s -p StartLimitBurst=3} \
107107
bash "${0}" run

pkg/roachprod/install/testdata/start/start.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ echo bar $HOME
2020
MEMORY_MAX=81%
2121
NUM_FILES_LIMIT=0
2222
VIRTUAL_CLUSTER_LABEL=cockroach-system
23+
24+
2325
ARGS=(
2426
start
2527
--log
@@ -103,6 +105,7 @@ sudo systemd-run --unit "${VIRTUAL_CLUSTER_LABEL}" \
103105
-p "MemoryMax=${MEMORY_MAX}" \
104106
-p LimitCORE=infinity \
105107
-p "LimitNOFILE=${NUM_FILES_LIMIT}" \
108+
${AUTO_RESTART:+-p Restart=always -p RestartSec=5s -p StartLimitIntervalSec=60s -p StartLimitBurst=3} \
106109
bash "${0}" run
107110
----
108111
----

0 commit comments

Comments
 (0)