spring-cloud/spring-cloud-task

Creating TaskExecution in a service and passing the executionId to the Task pod, start date is modified

zargarf opened this issue · 2 comments

Hi

In a spring-boot microservice, Service 1, I am creating a TaskExecution via the TaskRegistry createTaskExecution() method. The TaskExecution object has the start_time set of say: 2022-09-14 12:12:57.177 and has a task_execution_id of say 34. The entry is as expected in postgres.

At some point later Service 2 triggers a task and passes the property spring.cloud.task.executionid=34 to the task pod.
I would expect the start_time to remain as per the initial value as per service 1. However, the start_time changes when the task starts running. This looks to be happening automatically as part of the task's lifecycle.

If I use a TaskListener and log the TaskExecution object in the onTaskStartup method, then the start_time is not the same as the original start_time that was in the database when Service 1 created the entry.

I am using v2.4.4 of spring-cloud-task

Thank you for reporting!
This is a bug. I created issue #861 (I should have used the issue you opened ;-) ). A fix has been applied to main and has been backported.

Thanks for the prompt resolution - that's great!
When is the likely to be released?
Cheers