pforsthoff
pforsthoff

Reputation: 532

Anyone know why adding Micrometer dependencies to a Spring Cloud Dataflow Task causes the task pod to never complete?

I had 3 perfectly working spring cloud dataflow task applications that would execute and complete but would not show any metric data in Prometheus/Graphana, I added the following Gradle dependencies to the build.gradle file...

  1. implementation 'org.springframework.boot:spring-boot-starter-actuator'
  2. runtimeOnly group: 'org.springframework.cloud', name: 'spring-cloud-dependencies', version: 'Hoxton.SR12', ext: 'pom'
  3. implementation group: 'io.micrometer.prometheus', name: 'prometheus-rsocket-spring', version: '1.3.0'

After this the tasks now show up in the Grafana Task dashboard but... the tasks never complete in kubernetes, they just stay running.

I've tried adding the spring.cloud.task.closecontextEnabled=true argument to the task launcher message but this does not seem to have any affect on the pods.

I've checked the logs of those task pods and nothing interesting.

Is there a way to manually in code call something to end the pod or is there another way to enable the metrics collection without affecting the task pod behavior?

Any help would be appreciated.

Thanks,

Upvotes: 1

Views: 245

Answers (2)

pforsthoff
pforsthoff

Reputation: 532

Another discovery with the pods not changing from running to complete, make sure any open connections are closed. Had a NATS messaging connection in our tasks and if that connection was not closed properly the pod would get stuck running and never complete.

Upvotes: 0

pforsthoff
pforsthoff

Reputation: 532

Added the spring.cloud.task.closecontextEnabled=true to the application.yml file and now the pod is showing complete after it runs.

spring: 
  cloud:
    task:
      closecontextEnabled: true


  

Upvotes: 1

Related Questions