Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/abstract-node/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: abstract-node
description: External node for syncing and serving blockchain data for Abstract
version: 0.1.36
version: 0.1.37
type: application
icon: https://abstract-assets.abs.xyz/icons/light.png
keywords:
Expand Down
42 changes: 40 additions & 2 deletions charts/abstract-node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,37 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.args }}
{{- if .Values.shutdownWrapper.enabled }}
command:
- /bin/sh
- -ec
args:
- |
set -eu

child=0

forward_int() {
if [ "$child" -ne 0 ]; then
echo "Forwarding SIGINT to child process ${child}"
kill -INT "$child" 2>/dev/null || true
fi
}

trap 'forward_int' TERM
trap 'forward_int' INT

/usr/bin/entrypoint.sh "$@" &
child=$!

status=0
wait "$child" || status=$?
exit "$status"
Comment on lines +95 to +97
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Continue waiting after trapped termination signal

When shutdownWrapper.enabled is true and Kubernetes sends SIGTERM, the trap forwards SIGINT to the child, but in /bin/sh the wait call is interrupted and returns a signal status (commonly 143). This code then exits immediately with that status instead of waiting for the child to finish shutdown, so PID 1 terminates early and the external node can be killed before graceful cleanup completes. Keep waiting (or retry wait) after trapped signals until the child actually exits.

Useful? React with 👍 / 👎.

- wrapper
{{- range .Values.args }}
- {{ . | quote }}
{{- end }}
{{- else if .Values.args }}
args:
{{- range .Values.args }}
- {{ . | quote }}
Expand Down Expand Up @@ -97,7 +127,7 @@ spec:
- name: EN_ESTIMATE_GAS_ACCEPTABLE_OVERESTIMATION
value: "5000"
- name: DATABASE_POOL_SIZE
value: "10"
value: {{ .Values.database.poolSize | quote }}
- name: EN_HTTP_PORT
value: {{ .Values.rpc.http.port | quote }}
- name: EN_WS_PORT
Expand Down Expand Up @@ -130,6 +160,14 @@ spec:
value: "warn,zksync=info,zksync_web3_decl::client=error"
- name: EN_API_NAMESPACES
value: {{ .Values.rpc.api | quote }}
{{- if .Values.rpc.maxResponseBodySizeMb }}
- name: EN_MAX_RESPONSE_BODY_SIZE_MB
value: {{ .Values.rpc.maxResponseBodySizeMb | quote }}
{{- end }}
{{- if .Values.database.poolSizeMaster }}
- name: EN_DATABASE_MAX_CONNECTIONS_MASTER
value: {{ .Values.database.poolSizeMaster | quote }}
{{- end }}
{{- if .Values.node.batchCommitDataGeneratorMode }}
- name: EN_L1_BATCH_COMMIT_DATA_GENERATOR_MODE
value: {{ .Values.node.batchCommitDataGeneratorMode | quote }}
Expand Down
11 changes: 10 additions & 1 deletion charts/abstract-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ image:
pullPolicy: IfNotPresent
tag: "v29.14.0"

shutdownWrapper:
enabled: false

# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
imagePullSecrets: []
## Provide a name in place of abstract-node for `app:` labels
Expand Down Expand Up @@ -153,6 +156,10 @@ rpc:
## API Namespaces available via RPC
##
api: "eth,net,web3,debug,zks,pubsub"
##
## Maximum JSON-RPC response body size in MiB.
##
maxResponseBodySizeMb: null
## RPC configuration.
##
http:
Expand Down Expand Up @@ -242,6 +249,8 @@ resources: {}
database:
secretName: ""
secretKey: "uri"
poolSize: 10
poolSizeMaster: null

node:
## The URL of the Ethereum client.
Expand Down Expand Up @@ -362,4 +371,4 @@ cnpg:
checkpoint_completion_target: "0.9"
random_page_cost: "1.1"
effective_io_concurrency: "200"
max_worker_processes: "16"
max_worker_processes: "16"
Loading