Skip to content

Commit 04a13f9

Browse files
committed
Graceful container shutdown
Use stopsignal with buildImage Use exec so binary process is primary pid
1 parent 0f1d93f commit 04a13f9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Revision history for cardano-db-sync
22

3+
- Fixes an issue where stopping the docker container results in non graceful shutdown
4+
35
## 13.6.0.4
46
- Fixes an issue from ledger where DRep delegations could be removed under some conditions
57
- Fix an issue with migration from 13.5.x when consumed_tx_out config is enabled

Diff for: nix/docker.nix

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ let
2424

2525
baseImage = dockerTools.buildImage {
2626
name = "cardano-db-sync-base-env";
27-
config.Env = [ "NIX_SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt" ];
27+
config = {
28+
Env = [ "NIX_SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt" ];
29+
StopSignal = "SIGINT";
30+
};
2831

2932
copyToRoot = buildEnv {
3033
name = "base-image-env";
@@ -93,7 +96,7 @@ let
9396
db-sync = pkgs.writeScriptBin "cardano-db-sync-${service.cluster}" ''
9497
#!${runtimeShell}
9598
set -euo pipefail
96-
${service.script} $@
99+
exec ${service.script} $@
97100
'' // {
98101
passthru = { inherit service; };
99102
};

0 commit comments

Comments
 (0)