Skip to content

feat(scheduler): Make scheduler re-runnable - #103

Merged
zhak5388 merged 1 commit into
mainfrom
zhak/scheduler-reset
May 16, 2025
Merged

feat(scheduler): Make scheduler re-runnable#103
zhak5388 merged 1 commit into
mainfrom
zhak/scheduler-reset

Conversation

@zhak5388

@zhak5388 zhak5388 commented Apr 25, 2025

Copy link
Copy Markdown
Contributor

Issue

MINALAC-125

Changes

Modify Scheduler to make it resetable so tasks can be relaunched after completion.

Feature description

ScheduledTask contains now its dependencies (the others that need to be completed) and its dependants (the others tasks that depend on it).

The Scheduler now relies on the state of the tasks to manage task execution. runThenReset() replaces start() and waitUntilAllTasksFinished(): it starts the scheduler, waits for tasks completion and then reset it, so the scheduler can be re-run.

Reason

This will be needed for tiling generation.

Self-checks

  • The code has unit tests associated
  • The code has Javadoc Comments associated
  • Complex / Unexpected code is explained / justified with a small comment
  • Relevant documentation inside the /docs folder has been updated
  • All examples in docs/usage/Examples.md work the same (or have been adapted if subject to changes in this PR)
  • Git history is clean (each commit accomplish a single task and describe it accordingly)
  • The texts have been proofread (documentation, error messages, logs, comments...)

Questions/Others

  • Properly terminated ExecutorService ? (Same ExecutorService)
  • Change/Remove some ScheduledTaskState ?

Comment thread src/main/java/com/ignfab/minalac/generator/MinalacGenerator.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch from e5afa47 to bb099b7 Compare May 5, 2025 13:11
@github-actions

github-actions Bot commented May 5, 2025

Copy link
Copy Markdown

[Maven Build Status]

📑 Commit: 0ed04c05d08161362d6e624ea29d8c5d6ce0cf2a
⌚️ Date: 2025-05-15T17:34:56 (CEST)
🛠️ Status: ✅ Success

📦 Download artifact: Generator.jar

@zhak5388
zhak5388 marked this pull request as ready for review May 5, 2025 13:16
@zhak5388 zhak5388 self-assigned this May 5, 2025
@zhak5388 zhak5388 changed the title WIP feat(scheduler): make scheduler re-runable after task completion feat(scheduler): Make scheduler re-runable May 5, 2025
@zhak5388
zhak5388 requested a review from a team May 5, 2025 13:17
@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch 2 times, most recently from 8cee333 to dc5e407 Compare May 5, 2025 13:30
Comment thread src/main/java/com/ignfab/minalac/generator/parameters/GenerationCreator.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch 3 times, most recently from 9fd69fd to f4de93b Compare May 5, 2025 15:18
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch from f4de93b to b237069 Compare May 6, 2025 07:42
@indyteo indyteo changed the title feat(scheduler): Make scheduler re-runable feat(scheduler): Make scheduler re-runnable May 6, 2025

@indyteo indyteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il y a une faute dans le message de commit, runnable

@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch from b237069 to f180410 Compare May 6, 2025 09:07

@pyrollo pyrollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quelques remarques + validation à ajouter

Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch from f180410 to 5aa9150 Compare May 6, 2025 14:58
@zhak5388
zhak5388 requested review from indyteo and pyrollo May 13, 2025 16:27
@zhak5388

zhak5388 commented May 13, 2025

Copy link
Copy Markdown
Contributor Author

Du coup, rapidement, quelques changement depuis la dernière version!

  • Le lancement des taches est fait de manière un peu différente, basé sur une branche de Pierre-Yves, ça permet de détecter des deadlocks apparents.
  • Utilsation de Future pour pouvoir interrompre des taches qui tournent lorsqu'il y a par exemple une erreur et une meilleure propagration des Exception.

La javadoc et test sont bons, il me manque plus qu'un dernier squash. (A force de relire, il y a de grande chance qu'il me reste des coquilles, regarderai ça à tête reposée)

Edit: Vient de voir qu'un test ne passe pas ici, timeout trop court peut-être

@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch from f1bdd5e to c8ec307 Compare May 14, 2025 08:24

@pyrollo pyrollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai juste quelques remarques de style.
Je n'ai pas tout relu la javadoc, je ferai ça plus tard.

Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/ScheduledTask.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch 2 times, most recently from cf6f57e to 19129ac Compare May 14, 2025 08:49
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/ScheduledTask.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/ScheduledTask.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
pyrollo
pyrollo previously approved these changes May 14, 2025
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/MinalacGenerator.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/ScheduledTask.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/ScheduledTask.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/ScheduledTask.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/Scheduler.java Outdated
Comment thread src/main/java/com/ignfab/minalac/generator/utils/execution/ScheduledTask.java Outdated
Comment thread src/test/java/com/ignfab/minalac/generator/utils/execution/SchedulerTest.java Outdated
@zhak5388
zhak5388 requested a review from indyteo May 15, 2025 09:55
@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch from fe199da to ae480f4 Compare May 15, 2025 13:33

@indyteo indyteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il faut que tu nettoyes tes commits, sinon c'est bon pour moi :)

@zhak5388
zhak5388 force-pushed the zhak/scheduler-reset branch from ae480f4 to 0ed04c0 Compare May 15, 2025 15:34
@zhak5388
zhak5388 requested a review from indyteo May 15, 2025 15:38
@zhak5388
zhak5388 merged commit 24377c3 into main May 16, 2025
@zhak5388
zhak5388 deleted the zhak/scheduler-reset branch May 16, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants