When the pod is deleted in Kubernetes it can't terminate gracefully and is terminated forcefully after 30 seconds timeout
medvedev1088 opened this issue · comments
Steps to reproduce:
- Deploy one of streamers e.g. ethereum block data.
- Delete the pod.
- Observe that it takes 30 seconds to delete the pod and the return status is 127.
The suspected cause is the upload-last-synced-block-file
container can't terminate gracefully for some reason.
The suspected cause is the upload-last-synced-block-file container can't terminate gracefully for some reason.
Correct.
Please review PR #12
Closed by #12
This time the error code is 143.
Вероятно, с кодом ошибки 143 выходит прерываемый sleep 1, который есть в preStop
mail ~ # timeout --preserve-status 1 sleep 2
mail ~ # echo $?
143
А это, в свою очередь, значит, что pid-файл от ETL был на месте.
143 это 128+ 15 SIGTERM. То есть по факту это просто говорит нам что что-то было завершено через sigterm. А значит lifeCycle не успел отработать до конца в течении terminationGracePeriodSeconds
man bash
Simple Commands
A simple command is a sequence of optional variable assignments followed by blank-separated words and redirections, and terminated by a control operator. The first word specifies the com‐
mand to be executed, and is passed as argument zero. The remaining words are passed as arguments to the invoked command.
The return value of a simple command is its exit status, or 128+n if the command is terminated by signal n.