Skip to content

Commit a21afd6

Browse files
committed
Merge branch 'gdemay/CRP-2056-restart-csp-server-sooner' into 'master'
fix(crypto): CRP-2056 restart `ic-crypto-csp.service` after 100ms If `ic-crypto-csp.service` is killed for whatever reason (e.g., due to a bug resulting in the server panicking), systemd currently waits for `10s` before restarting the service. A side effect of the automatic reconnection of CSP vault clients introduced in [MR-11747](https://gitlab.com/dfinity-lab/public/ic/-/merge_requests/11747) is that any request being made to the CSP vault server after it was killed will hang until the server was restarted by systemd, which means that callers of the CSP vault clients may have to wait up to 10s before receiving a response (starting the CSP vault server is usually very fast and takes much less than 1s). This MR changes the configuration of `ic-crypto-csp.service` so that in such a case the server restarts after 100ms (default value for [`RestartSec`](https://manpages.ubuntu.com/manpages/focal/man5/systemd.service.5.html)). To prevent a repeatedly failing start of `ic-crypto-csp.service` to pollute logs unnecessarily, start rate limiting is also applied: `ic-crypto-csp.service` will be started at most 5 times within 60s. See merge request dfinity-lab/public/ic!12556
2 parents 1b971ae + d845fe6 commit a21afd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ic-os/guestos/rootfs/etc/systemd/system/ic-crypto-csp.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Wants=bootstrap-ic-node.service
88
After=setup-permissions.service
99
Wants=setup-permissions.service
1010
Requires=ic-crypto-csp.socket
11-
StartLimitIntervalSec=0
11+
StartLimitBurst=5
12+
StartLimitIntervalSec=5
1213

1314
[Service]
1415
UMask=066
@@ -23,7 +24,6 @@ ExecStartPre=+/opt/ic/bin/generate-replica-config.sh -i /opt/ic/share/ic.json5.t
2324
ExecStart=/opt/ic/bin/ic-crypto-csp --replica-config-file /run/ic-node/config/ic-crypto-csp.json5
2425
NotifyAccess=main
2526
Restart=always
26-
RestartSec=10
2727

2828
[Install]
2929
WantedBy=ic-replica.service

0 commit comments

Comments
 (0)