liumengkai opened a new issue, #6142:
URL: https://github.com/apache/seatunnel/issues/6142

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   当我使用自己写的batch任务替代掉k8s 
demo中的streaming任务之后,重新运行,我发现pod在执行完毕任务之后一直重启,一直在重复执行任务,看到pod中的日志显示任务是成功的,是我的方式有问题吗?还是seatunnel的batch任务不能优雅退出pod之类的,像是一直被k8s认为是失败的pod自动拉起,不确定这是不是个bug
   
   When I used the batch task I wrote to replace the streaming task in the k8s 
demo and re-run it, I found that the pod kept restarting after completing the 
task and repeatedly executing the task. The log in the pod showed that the task 
was successful.Is there something wrong with my approach? Or is it that the 
batch task of seatunnel cannot exit the pod gracefully?It seems that it has 
been automatically pulled up by k8s as a failure pod. Not sure is this a bug
   
   ### SeaTunnel Version
   
   2.3.3
   
   ### SeaTunnel Config
   
   ```conf
   任务脚本
   
   env {
     execution.parallelism = 1
     job.mode = "BATCH"
   }
   
   source {
     FakeSource {
       result_table_name = "fake"
       row.num = 16
       schema = {
         fields {
           name = "string"
           age = "int"
         }
       }
     }
   }
   
   transform {
     FieldMapper {
       source_table_name = "fake"
       result_table_name = "fake1"
       field_mapper = {
         age = age
         name = new_name
       }
     }
   }
   
   sink {
     Console {
       source_table_name = "fake1"
     }
   }
   ```
   
   
   提交任务yaml配置文件
   ```
   apiVersion: v1
   kind: Pod
   metadata:
     name: seatunnel
   spec:
     containers:
     - name: seatunnel
       image: registy.adtiming.com/seatunnel:2.3.3
       imagePullPolicy: Always
       command: ["/bin/sh","-c","/opt/seatunnel/bin/seatunnel.sh --config 
/data/seatunnel.batch.conf -e local"]
       resources:
         limits:
           cpu: "1"
           memory: 1G
         requests:
           cpu: "1"
           memory: 1G
       volumeMounts:
         - name: seatunnel-config
           mountPath: /data/seatunnel.batch.conf
           subPath: seatunnel.batch.conf
     volumes:
           - name: seatunnel-config
             configMap:
               name: seatunnel-config
               items:
               - key: seatunnel.batch.conf
                 path: seatunnel.batch.conf
   ```
   ```
   
   
   ### Running Command
   
   ```shell
   kubectl apply -f seatunnel.yaml
   ```
   
   
   ### Error Exception
   
   ```log
   kubectl describe pod seatunnel
   
   
   Name:             seatunnel
   Namespace:        default
   Priority:         0
   Service Account:  default
   Node:             10.218.110.132/10.218.110.132
   Start Time:       Fri, 05 Jan 2024 16:41:21 +0800
   Labels:           <none>
   Annotations:      <none>
   Status:           Running
   IP:               10.244.3.196
   IPs:
     IP:  10.244.3.196
   Containers:
     seatunnel:
       Container ID:  
cri-o://1d264551e7d74b87229181aa405e2bb1a5ad694c20b2d6ff8ca5a7edb5f693a5
       Image:         registy.adtiming.com/seatunnel:2.3.3
       Image ID:      
registy.adtiming.com/seatunnel@sha256:a9316ba0fdc88bf8c445882b5eff269e2cd01ad05d2ef81fbfc59037d4ac8cf3
       Port:          <none>
       Host Port:     <none>
       Command:
         /bin/sh
         -c
         /opt/seatunnel/bin/seatunnel.sh --config /data/seatunnel.batch.conf -e 
local
       State:          Waiting
         Reason:       CrashLoopBackOff
       Last State:     Terminated
         Reason:       Completed
         Exit Code:    0
         Started:      Fri, 05 Jan 2024 16:42:25 +0800
         Finished:     Fri, 05 Jan 2024 16:42:34 +0800
       Ready:          False
       Restart Count:  3
       Limits:
         cpu:     1
         memory:  1G
       Requests:
         cpu:        1
         memory:     1G
       Environment:  <none>
       Mounts:
         /data/seatunnel.batch.conf from seatunnel-config 
(rw,path="seatunnel.batch.conf")
         /var/run/secrets/kubernetes.io/serviceaccount from 
kube-api-access-zm6hp (ro)
   Conditions:
     Type              Status
     Initialized       True
     Ready             False
     ContainersReady   False
     PodScheduled      True
   Volumes:
     seatunnel-config:
       Type:      ConfigMap (a volume populated by a ConfigMap)
       Name:      seatunnel-config
       Optional:  false
     kube-api-access-zm6hp:
       Type:                    Projected (a volume that contains injected data 
from multiple sources)
       TokenExpirationSeconds:  3607
       ConfigMapName:           kube-root-ca.crt
       ConfigMapOptional:       <nil>
       DownwardAPI:             true
   QoS Class:                   Guaranteed
   Node-Selectors:              <none>
   Tolerations:                 node.kubernetes.io/not-ready:NoExecute 
op=Exists for 300s
                                node.kubernetes.io/unreachable:NoExecute 
op=Exists for 300s
   Events:
     Type     Reason     Age                From               Message
     ----     ------     ----               ----               -------
     Normal   Scheduled  98s                default-scheduler  Successfully 
assigned default/seatunnel to 10.218.110.132
     Normal   Pulled     98s                kubelet            Successfully 
pulled image "registy.adtiming.com/seatunnel:2.3.3" in 86.48923ms (86.505892ms 
including waiting)
     Normal   Pulled     87s                kubelet            Successfully 
pulled image "registy.adtiming.com/seatunnel:2.3.3" in 45.919197ms (45.928354ms 
including waiting)
     Normal   Pulled     66s                kubelet            Successfully 
pulled image "registy.adtiming.com/seatunnel:2.3.3" in 38.625896ms (38.637969ms 
including waiting)
     Normal   Pulling    35s (x4 over 98s)  kubelet            Pulling image 
"registy.adtiming.com/seatunnel:2.3.3"
     Normal   Created    35s (x4 over 98s)  kubelet            Created 
container seatunnel
     Normal   Started    35s (x4 over 98s)  kubelet            Started 
container seatunnel
     Normal   Pulled     35s                kubelet            Successfully 
pulled image "registy.adtiming.com/seatunnel:2.3.3" in 58.336391ms (58.345898ms 
including waiting)
     Warning  BackOff    10s (x5 over 78s)  kubelet            Back-off 
restarting failed container seatunnel in pod 
seatunnel_default(05ab8ff2-284d-4f22-a140-8eed46a3f809)
   ```
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   _No response_
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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