Miretpl commented on code in PR #69608:
URL: https://github.com/apache/airflow/pull/69608#discussion_r3554898548
##########
chart/values.schema.json:
##########
@@ -7827,7 +7827,7 @@
"command": [
"/bin/sh",
"-c",
- "killall -INT pgbouncer && sleep 120"
+ "sleep 10 && killall -INT pgbouncer &&
sleep 20"
Review Comment:
```suggestion
"sleep 10 && killall -INT pgbouncer"
```
##########
chart/values.yaml:
##########
@@ -2859,8 +2859,10 @@ pgbouncer:
containerLifecycleHooks:
preStop:
exec:
- # Allow existing queries clients to complete within 120 seconds
- command: ["/bin/sh", "-c", "killall -INT pgbouncer && sleep 120"]
+ # Sleep first so the pod is marked Terminating and removed from
+ # Service endpoints before pgbouncer stops accepting connections,
+ # then gracefully drain existing queries.
Review Comment:
```suggestion
# Sleep first to give time to Kubernetes for removing Service
endpoints
# before PgBouncer stops accepting and draining existing connections.
```
A bit shorter version
##########
chart/tests/helm_tests/airflow_aux/test_container_lifecycle.py:
##########
@@ -55,7 +55,7 @@ def test_check_default_setting(self):
assert
jmespath.search("spec.template.spec.containers[0].lifecycle", doc) is None
pgbouncer_default_value = {
- "exec": {"command": ["/bin/sh", "-c", "killall -INT pgbouncer &&
sleep 120"]}
+ "exec": {"command": ["/bin/sh", "-c", "sleep 10 && killall -INT
pgbouncer && sleep 20"]}
Review Comment:
```suggestion
"exec": {"command": ["/bin/sh", "-c", "sleep 10 && killall -INT
pgbouncer"]}
```
I think that it doesn't do anything really (unless I'm missing something).
##########
chart/values.yaml:
##########
@@ -2859,8 +2859,10 @@ pgbouncer:
containerLifecycleHooks:
preStop:
exec:
- # Allow existing queries clients to complete within 120 seconds
- command: ["/bin/sh", "-c", "killall -INT pgbouncer && sleep 120"]
+ # Sleep first so the pod is marked Terminating and removed from
+ # Service endpoints before pgbouncer stops accepting connections,
+ # then gracefully drain existing queries.
+ command: ["/bin/sh", "-c", "sleep 10 && killall -INT pgbouncer &&
sleep 20"]
Review Comment:
```suggestion
command: ["/bin/sh", "-c", "sleep 10 && killall -INT pgbouncer"]
```
--
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]