-
Notifications
You must be signed in to change notification settings - Fork 175
Description
Package version (if known): latest, v13
Describe the bug
When scheduling a job with interval type in the admin UI, the system enters an endless loop if no numeric values are entered in the interval fields OR if all interval fields are set to 0.
This occurs because a zero-valued timedelta is created, causing the scheduler to execute the job continuously without any delay between runs.
Steps to Reproduce
- Go to the Jobs administration page
- Click on "Schedule" action for any job
- Select "interval" as the schedule type
- Leave all interval fields (microseconds, milliseconds, seconds, minutes, hours, days, weeks) empty OR set all of them to 0
- Click "Save"
- The system enters an endless loop state "after few minutes on my local testings"
Expected behavior
The system should validate that at least one interval field has a positive value and prevent submission of invalid schedules. A clear error message should be displayed to the user indicating that at least one interval field must be greater than 0.
Additional context
The issue appears to stem from two problems:
Frontend: The ScheduleJobModal component doesn't validate interval values before submission ScheduleJobModal.js
The form allows empty or zero values to be submitted. if the value is too small "under a second" then maybe its safe to ignore or reject the form value.
Backend: TheIntervalScheduleSchema doesn't enforce that at least one field must be greater than 0 schema.py
When all fields are 0 or empty, Job.parsed_schedule creates a timedelta(**schedule) with all zero values, causing infinite execution.