edgexfoundry / edgex-go

EdgeX Golang Services Monorepo | Owner: Core/Support WG
Apache License 2.0
1.33k stars 480 forks source link

Fail to update job with definition timestamp #4881

Closed cherrycl closed 5 days ago

cherrycl commented 1 week ago

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in: support-cron-scheduler ### Is this a regression? No ### Description and Minimal Reproduction [**REQUIRED**] 1. Create schedule job by API `/api/v3/job` with the following request body ``` POST /api/v3/job [ { "apiVersion": "v3", "scheduleJob": { "name": "test_job_8", "definition": { "type": "INTERVAL", "startTimestamp": 1726438942000, "endTimestamp": 1736438942000, "interval": "10s" }, "actions": [ { "type": "REST", "contentType": "application/json", "address": "http://localhost:59881/api/v3/ping", "method": "GET" } ] } } ] ``` 2. Update the schedule job ``` [ { "apiVersion": "v3", "scheduleJob": { "name": "test_job_8", "definition": { "type": "INTERVAL", "endTimestamp": 1746438942000 } } } ] ``` ## πŸ”₯ Exception or Error Update job failed.

[
    {
        "apiVersion": "v3",
        "message": "fail to parse interval string  to a duration time value",
        "statusCode": 400
    }
]

🌍 Your Environment

Deployment Environment: Ubuntu 2204 / arm64

EdgeX Version [REQUIRED]: Main

Anything else relevant? Send the update request again, will return the job not exist. But the job still can be found by API /job/name/test_job_8

jackchenjc commented 1 week ago

This is an expected behavior at the moment.

We need to consider whether to support updating partial values of the definition object.

cc @cloudxxx8

cloudxxx8 commented 1 week ago

right, we can only partially update the first level fields. definition has to be full defined. close this issue because it works as design,

cherrycl commented 1 week ago

This scenario is not only return error, it seems make the job not found by PATH /job API

See the description on Anything else relevant? section

cloudxxx8 commented 1 week ago

I see. That's an issue we should fix.