dlg99 commented on a change in pull request #12504:
URL: https://github.com/apache/pulsar/pull/12504#discussion_r737100648



##########
File path: 
pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
##########
@@ -567,7 +567,12 @@ private void submitStatefulSet() throws Exception {
     public void deleteStatefulSet() throws InterruptedException {
         String statefulSetName = 
createJobName(instanceConfig.getFunctionDetails(), this.jobName);
         final V1DeleteOptions options = new V1DeleteOptions();
-        options.setGracePeriodSeconds(5L);
+        // gracePeriodSeconds == 0 to force pod deletion and
+        // avoid cases when pod hangs during termination
+        // 
https://amalgjose.com/2021/07/28/how-to-delete-a-kubernetes-pod-which-is-stuck-in-terminating-state/
+        // 
https://www.ibm.com/support/pages/kubernetes-pods-are-stuck-terminating-state
+        // https://github.com/kubernetes-client/java/issues/770
+        options.setGracePeriodSeconds(0L);

Review comment:
       @jerrypeng fixed.




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