Skip to content

Commit 6df464a

Browse files
sdaberdakunineinchnick
authored andcommitted
Enhance graceful shutdown handling in worker deployment
1 parent c5a476e commit 6df464a

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

charts/trino/templates/deployment-worker.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,15 @@ spec:
218218
command:
219219
- /bin/sh
220220
- -c
221-
- >-
222-
curl -v -X PUT
223-
-d '"SHUTTING_DOWN"'
224-
-H 'Content-type: application/json'
225-
-H 'X-Trino-User: admin'
226-
http://localhost:{{- .Values.service.port -}}/v1/info/state
221+
- |-
222+
# send shutdown request to worker
223+
curl -v -X PUT \
224+
-d '"SHUTTING_DOWN"' \
225+
-H 'Content-type: application/json' \
226+
-H 'X-Trino-User: admin' \
227+
http://localhost:{{- .Values.service.port -}}/v1/info/state
228+
# wait for shutdown to complete
229+
tail --pid=1 -f /dev/null
227230
{{- end }}
228231
resources:
229232
{{- toYaml .Values.worker.resources | nindent 12 }}

charts/trino/templates/tests/test-graceful-shutdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ metadata:
1515
rules:
1616
- apiGroups: [ "" ]
1717
resources: [ "pods" ]
18-
verbs: [ "get", "list", "delete" ]
18+
verbs: [ "delete", "get", "list", "watch" ]
1919
- apiGroups: [ "" ]
2020
resources: [ "pods/log" ]
2121
verbs: [ "get" ]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
worker:
22
gracefulShutdown:
33
enabled: true
4-
gracePeriodSeconds: 60
4+
gracePeriodSeconds: 5
55

66
terminationGracePeriodSeconds: 120

0 commit comments

Comments
 (0)