HsiuChuanHsu commented on issue #56349:
URL: https://github.com/apache/airflow/issues/56349#issuecomment-3368243682
I was able to reproduce the behavior as yours. Despite setting the
`termination_grace_period` to 3, 300, and the default across three different
DAGs, the system appears to be default value to 30.
```python
# test_kpo_termination_grace_period_3s
test_3s_grace_period = KubernetesPodOperator(
namespace="default",
image="ubuntu:22.04",
cmds=["bash", "-cx"],
arguments=["echo 'Testing termination_grace_period=3'; sleep 5; echo
'Done'"],
labels={"test": "termination-grace-period"},
name="test-grace-period-3",
task_id="test_grace_period_3_seconds",
termination_grace_period=3,
get_logs=True,
)
# test_kpo_termination_grace_period_300s
test_300s_grace_period = KubernetesPodOperator(
namespace="default",
image="ubuntu:22.04",
cmds=["bash", "-cx"],
arguments=["echo 'Testing termination_grace_period=300'; sleep 5;
echo 'Done'"],
labels={"test": "termination-grace-period"},
name="test-grace-period-300",
task_id="test_grace_period_300_seconds",
termination_grace_period=300,
get_logs=True,
)
# test_kpo_termination_grace_period_default
test_default_grace_period = KubernetesPodOperator(
namespace="default",
image="ubuntu:22.04",
cmds=["bash", "-cx"],
arguments=["echo 'Testing default termination_grace_period'; sleep
5; echo 'Done'"],
labels={"test": "termination-grace-period"},
name="test-grace-period-default",
task_id="test_grace_period_default",
# No termination_grace_period specified
get_logs=True,
)
```
<img width="1281" height="311" alt="Image"
src="https://github.com/user-attachments/assets/c82f5370-1531-4601-83ff-22b62a68737d"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]