mesos / chronos

Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules
http://mesos.github.io/chronos/
Apache License 2.0
4.39k stars 529 forks source link

Disabling a job via the web ui breaks the job configuration. #639

Open stephanh opened 8 years ago

stephanh commented 8 years ago

I have a job that is created using the REST api. When I use the web UI to disable the job it changes the rest of the job configuration.

Job as it was created:

{
    "name": "dev_stephan_test",
    "command": "sleep",
    "shell": false,
    "epsilon": "PT5M",
    "executor": "",
    "executorFlags": "",
    "retries": 1,
    "owner": "stephan.hoermann@cba.com.au",
    "ownerName": "stephan",
    "description": "test",
    "async": false,
    "successCount": 0,
    "errorCount": 0,
    "lastSuccess": "",
    "lastError": "",
    "cpus": 0.1,
    "disk": 256.0,
    "mem": 128.0,
    "disabled": false,
    "softError": false,
    "dataProcessingJobType": false,
    "errorsSinceLastSuccess": 0,
    "uris": [],
    "environmentVariables": [
        {
            "name": "originalSchedule",
            "value": "R\/2500-08-23T10:00:00.000+10:00\/PT5M"
        },
        {
            "name": "OMNIA_ENVIRONMENT",
            "value": "local.dev"
        }
    ],
    "arguments": [
        "3600"
    ],
    "highPriority": false,
    "runAsUser": "root",
    "container": {
        "type": "docker",
        "image": "alpine",
        "network": "HOST",
        "volumes": [],
        "forcePullImage": false
    },
    "constraints": [],
    "schedule": "R\/2500-08-23T10:00:00.000+10:00\/PT5M",
    "scheduleTimeZone": "Australia\/Sydney"
}

Job after using the web ui to disable it:

{
    "name": "dev_stephan_test",
    "command": "sleep",
    "shell": true,
    "epsilon": "PT5M",
    "executor": "",
    "executorFlags": "",
    "retries": 2,
    "owner": "stephan.hoermann@cba.com.au",
    "ownerName": "stephan",
    "description": "test",
    "async": false,
    "successCount": 0,
    "errorCount": 0,
    "lastSuccess": "",
    "lastError": "",
    "cpus": 0.1,
    "disk": 256.0,
    "mem": 128.0,
    "disabled": true,
    "softError": false,
    "dataProcessingJobType": false,
    "errorsSinceLastSuccess": 0,
    "uris": [],
    "environmentVariables": [],
    "arguments": [],
    "highPriority": false,
    "runAsUser": "root",
    "constraints": [],
    "schedule": "R\/2500-08-23T10:00:00Z\/PT5M",
    "scheduleTimeZone": ""
}
colinmjj commented 8 years ago

Hi, @stephanh , for this problem, I think it's a bug in web ui. When save the job configuration with web ui, the following rest api will be called: PUT http://:/scheduler/iso8601 with the attributes: async,command,cpus,description,disabled,disk,epsilon,executor,highPriority,mem,name,owner,ownerName,schedule,softError The new job will be created with these attributes and replace the old job.

There is no environmentVariables, arguments, container, constraints, scheduleTimeZone. So all these attributes will be discarded if save the job with web ui.

I think adding these missing attributes when save the job with web ui can fix this problem.

franzhcs commented 8 years ago

This is a severe bug. Any interaction on the UI is breaking all the jobs. Even if you just edit and click "save", this will wipeout all the settings.