Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ScheduledJobQueue for Prioritized Job Management and Execution #740

Closed
VictorCavichioli opened this issue Oct 13, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request PoC/Agent Tasks related to new generation of ecchronos as an agent

Comments

@VictorCavichioli
Copy link
Contributor

Story Description:

The ScheduledJobQueue class is designed to manage a queue of ScheduledJob objects, ensuring that jobs are prioritized and handled based on a comparator. It supports adding, removing, and iterating over jobs with proper synchronization. The jobs in the queue are managed by their state and priority, with specific actions taken when jobs reach states like FAILED, FINISHED, or PARKED.

This user story will focus on the following:

  1. Implementing the ScheduledJobQueue to support scheduling, prioritization, and execution of jobs based on their states.
  2. Integrating a RunnableJobIterator that manages job execution by inspecting the state of each job and descheduling jobs when necessary.
  3. The expected changes will involve adding the described functionality to the ScheduledJobQueue class and ensuring correct behavior for adding/removing jobs, iterating over jobs, and managing job states during execution.

Acceptance Criteria:

  1. The ScheduledJobQueue should properly handle job addition and removal based on priority using the provided comparator.
  2. The class should provide synchronized access for adding and removing jobs to ensure thread safety.
  3. The RunnableJobIterator must correctly iterate over the jobs, retrieve jobs in the correct order, and remove jobs that are in FAILED or FINISHED states.
  4. The queue must refresh the state of each job during iteration.
  5. Test cases should cover the behavior of adding, removing, and iterating over jobs, as well as proper job state handling.

Definition of Done:

  1. Implementation of ScheduledJobQueue class, with correct handling of job priority and states.
  2. Proper synchronization in place for job addition, removal, and iteration.
  3. Unit tests should cover all the methods, ensuring proper behavior in multi-threaded environments.
  4. Code reviewed and merged into the main code base, ensuring no regression in job scheduling functionality.

Notes:

Related with #652
Depends of #737

@VictorCavichioli VictorCavichioli added enhancement New feature or request PoC/Agent Tasks related to new generation of ecchronos as an agent labels Oct 13, 2024
@VictorCavichioli VictorCavichioli self-assigned this Oct 13, 2024
@VictorCavichioli
Copy link
Contributor Author

PR merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PoC/Agent Tasks related to new generation of ecchronos as an agent
Projects
None yet
Development

No branches or pull requests

1 participant