Miretpl commented on code in PR #74593:
URL: https://github.com/apache/airflow/pull/74593#discussion_r4575929246


##########
chart/tests/helm_tests/airflow_aux/test_container_lifecycle.py:
##########
@@ -50,18 +50,11 @@ def test_check_default_setting(self):
             ],
         )
 
-        # Default for every service is None except for pgbouncer
-        for doc in docs[:-1]:
+        # No service, including pgbouncer, sets lifecycle hooks by default.
+        # PgBouncer relies on SIGTERM and terminationGracePeriodSeconds to 
drain.

Review Comment:
   ```suggestion
   ```



##########
chart/values.yaml:
##########
@@ -2944,17 +2944,17 @@ pgbouncer:
     pod: {}
     container: {}
 
-  # Container level lifecycle hooks
-  containerLifecycleHooks:
-    preStop:
-      exec:
-        # Allow existing queries clients to complete within 120 seconds
-        command: ["/bin/sh", "-c", "killall -INT pgbouncer && sleep 120"]
+  # Container level lifecycle hooks.
+  # No preStop hook is set by default. On shutdown Kubernetes sends SIGTERM to
+  # PgBouncer, which keeps serving the clients that are already connected and
+  # exits once they have all disconnected (or when 
terminationGracePeriodSeconds
+  # runs out). Meanwhile the terminating pod is removed from the Service
+  # endpoints, so new connections go to the remaining pods.

Review Comment:
   ```suggestion
     # No preStop hook is set by default. On shutdown Kubernetes sends SIGTERM 
to
     # PgBouncer, which keeps serving the clients that are already connected and
     # exits once they have all disconnected (or when 
terminationGracePeriodSeconds
     # runs out).
   ```
   Removed part is just how things work on Kubernetes which should be 
well-known for people using helm.



-- 
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]

Reply via email to